SHARE
TWEET

Untitled

a guest Oct 2nd, 2017 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top