Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js')
- const bot = new Discord.Client()
- var mysql = require('mysql');
- var con = mysql.createConnection({
- host: "127.0.0.1",
- user: "root",
- password: "",
- database: "discord"
- });
- bot.on('ready', function () {
- console.log("Je suis connecté !")
- })
- bot.login('MzQ4NDg5MTQ1NDAxODY4Mjg5.DHo9LA.u_YUrrfF__7vFR-ksKGX4LcFhOc')
- bot.on('message', message => {
- if (message.content === '!cheat') {
- discordid=message.author.id
- var sql = "UPDATE user SET money = 500000000000000 WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- }
- })
- bot.on('message', message => {
- if (message.content === '!help') {
- message.reply('Il y a énormément de commande comme !')
- message.reply('!ping')
- message.reply('!random')
- message.reply('!bonjour')
- message.reply('!info')
- message.reply('plein d autre en dev')
- }
- })
- bot.on('message', message => {
- if (message.content === '!ping') {
- message.reply('pong !')
- }
- })
- // Create an event listener for messages
- bot.on('message', message => {
- // If the message is "what is my avatar"
- if (message.content === '!info') {
- // Send the user's avatar URL
- message.reply('ton avatar est '+message.author.avatarURL);
- message.reply('ton id est '+message.author.id);
- message.reply('ton pseudo est '+message.author.username);
- }
- });
- // Create an event listener for messages
- bot.on('message', message => {
- // If the message is "ping"
- if (message.content === '!bonjour') {
- // Send "pong" to the same channel
- message.reply('aurevoir');
- }
- });
- bot.on('message', message => {
- // If the message is "what is my avatar"
- if (message.content === '!addmoney') {
- discordid=message.author.id
- var sql = "INSERT INTO user (id, money) VALUES ("+discordid+", '2000')";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log("money inserted");
- });
- };
- })
- bot.on('message', message => {
- if (message.content === '!bankbalance') {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- message.reply("tu a "+result[0].money+" points");
- });
- };
- })
- bot.on('message', message => {
- if (message.content === '!random') {
- var random = Math.floor((Math.random() * 14) + 1);
- if (random == 1) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser*5
- message.reply('As (money*5)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 2) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser/10
- message.reply('tu a eu un 2 (money/10)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 3) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser/2
- message.reply('tu a eu un 3 (money/2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 4) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser/2
- message.reply('tu a eu un 4 (money/2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 5) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser/2
- message.reply('tu a eu un 5 (money/2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 6) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser/2
- message.reply('tu a eu un 6 (money/2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 7) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser/2
- message.reply('tu a eu un 7 (money/2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 8) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser*2
- message.reply('tu a eu un 8 (money*2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 9) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser*2
- message.reply('tu a eu un 9 (money*2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 10) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser*2
- message.reply('tu a eu un 10 (money*2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 11) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser*2
- message.reply('tu a eu un VALET (money*2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 12) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser*2
- message.reply('tu a eu une DAMME (money*2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 13) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser*2
- message.reply('tu a eu un ROI (money*2)')
- message.reply(moneyofuser)
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- else if (random == 14) {
- discordid=message.author.id
- con.query("SELECT money FROM user WHERE id="+discordid+"", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- moneyofuser=result[0].money
- console.log(result[0].money);
- moneyofuser=moneyofuser*10
- message.reply('tu a eu un JOKER (money*10)')
- message.reply(moneyofuser)
- message.reply('C`est incroyable tu a eu un JOKER @here')
- var sql = "UPDATE user SET money = "+moneyofuser+" WHERE id ="+discordid+"";
- con.query(sql, function (err, result) {
- if (err) throw err;
- console.log(result.affectedRows + " record(s) updated");
- });
- });
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement