Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const mysql = require('mysql');
  3. var con = mysql.createConnection({
  4. host: "localhost",
  5. user: "yourusername",
  6. password: "yourpassword"
  7. });
  8. con.connect(function(err) {
  9. if (err) throw err;
  10. console.log("Connected!");
  11. });
  12. const client = new Discord.Client();
  13. const token = 'your bot token here';
  14. client.on('message', message => {
  15. con.query("INSERT INTO counts (user, channel) VALUES("+ message.author + message.channel + ")", function(){
  16. });
  17. });
  18. client.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement