Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const client = new Discord.Client();
- let balances = new Discord.Collection()
- client.on('ready', () => {
- console.log('Ready!');
- });
- client.login('123456789');
- const TOKEN = "123456789"
- const prefix = "**"
- var bot = new Discord.Client();
- bot.on ("message", function(message) {
- console.log(`${message.guild}, ${message.channel.name}, ${message.author.tag}: ${message.content}`);
- //message.guild.channels.find("name", "test").send(`${message.guild}, ${message.channel.name}, ${message.author.tag}: ${message.content}`);
- });
- bot.login(TOKEN);
- client.on('ready', async () => {
- console.log('logged in as Xeukxz!');
- client.user.setGame('**help');
- });
- client.on("message", message => {
- var command = function(input,output){
- if (message.author.equals(client.user)) return;
- if (message.content.toLowerCase() === prefix + input) {
- message.channel.send(output);
- };
- };
- //trigger words
- if(message.content == "fuck you") {
- message.author.send("nah fuck you")
- message.delete();
- }
- if(message.content == "delete") {
- message.channel.sendMessage("Im A Faggot")
- message.delete();
- }
- if(message.content == "ping") {
- message.channel.send("pong")
- }
- //variables
- var spin = [Math.floor(Math.random() * 20)]
- var coinflip = ["Heads", "Tails"]
- //commands
- if(message.content == prefix + "code") {
- message.channel.send("https://pastebin.com/nvVeB3Zd")
- }
- // command("help", "**commands:** \n `**Shop` \n `**dice` \n `**spin` \n `**invite`");
- // command("shop", "**Shop** \n `token` - `Used To Spin The Wheel` \n `dice` - `Used To Roll Dices`");
- command("coinflip", coinflip[Math.floor(Math.random() * 2)]);
- command("mk", "Mk");
- command("working?", "Yes It Is Working!");
- //Local Currencies
- if(message.content == prefix + "tickets") {
- message.channel.send(tickets)
- }
- if(message.content == prefix + "tokens") {
- message.channel.send(tokens)
- }
- if(message.content == prefix + "points") {
- message.channel.send(points)
- }
- let user = balances[message.author.id]
- if(user == undefined) {
- balances[message.author.id] = {
- name: message.author.tag,
- balance: 5,
- tokens: 1,
- spins: 1,
- }
- user = balances[message.author.id]
- }
- if(!message.content.startsWith('**')) return;
- const args = message.content.substring(prefix.length).split(' ');
- switch (args[0]) {
- case 'bal':
- message.channel.send(user.balance)
- break;
- case 'debug':
- console.log(balances)
- break;
- case 'spin':
- if(tokens > 0) {
- tokens -= 1
- message.channel.send(`You Have Won ${spin} tickets`)
- tickets += spin
- } else if(tokens <= 0){
- message.channel.send("You Dont Have Enough Tokens")
- }
- break;
- case 'help':
- message.channel.send('`**commands:**` \n `**Shop` \n `**dice` \n `**spin` \n `**invite`')
- }
- if(message.content == prefix + "test"){
- message.channel.send("Test Successful!")
- }
- if(message.content == prefix + "ping") {
- message.channel.send("pong")
- }
- if(message.content == prefix + "invite") {
- message.channel.send("https://discordapp.com/oauth2/authorize?client_id=360106811287928834&scope=bot&permissions=2146958591")
- }
- //other shit
- client.on('message', function(message) {
- if (message.author.bot) return;
- // **askmaker how are you?
- // howareyou
- // how are you
- // args = ['askmaker', 'how', 'are', 'you?']
- const args = message.content.substring(prefix.length).split(' ');
- })
- var dice = "dice"
- var dice1 = Math.floor(Math.random(1) * 6)
- var dice2 = Math.floor(Math.random(1) * 6)
- if(message.content == prefix + "dice") {
- if(dice >= 1) {
- dice -= 1;
- if(dice1 > dice2) {
- message.channel.send(`I rolled a ${dice1}, you rolled a ${dice2} therefor I win and you lost 1 point!`)
- points -= 1;
- } else if (dice1 < dice2) {
- message.channel.send(`I rolled a ${dice1}, you rolled a ${dice2} therefor you win and earned 2 points!`)
- points += 2;
- }
- }else if(dice == 0) {
- message.channel.send("You Do Not Have Enough Dice")
- }else if(dice < 0) {
- message.channel.send("there is a serious problem with thisbot and you must report this to the creator. message `Xeukxz#4192` and say `code blue` as if you do not then this bot may become unstable")
- }
- }
- if(message.content == prefix + 'shop') {
- switch (args[0]) {
- case 'shop':
- if(args[1] == undefined) {
- return message.channel.send("You Need To State What You Would Like To Buy")
- }
- else if(args[1] == 'buy') {
- if(args[2] == 'token') {
- if(balances >=20 ){
- message.channel.send("success")
- balances -= 20;
- tokens += 1;
- }}else if(balances <= 20){
- message.channel.send(`You Need A Ballance Of 20. You Have A Ballance Of ${user.balance}`)
- }
- }else if(args[2] == 'dice'){
- if(balances >= 20) {
- message.channel.send("success")
- balances -= 20;
- dice += 1
- }else if(balances <= 20) {
- message.channel.send(`You Need A Ballance Of 20. You Have A Ballance Of ${user.balance}`)
- }
- }
- }
- }
- });
- let dice = 1
- let tickets = 0
- let tokens = 1
- let points = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement