Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const mysql = require('mysql');
- var con = mysql.createConnection({
- host: "localhost",
- user: "yourusername",
- password: "yourpassword"
- });
- con.connect(function(err) {
- if (err) throw err;
- console.log("Connected!");
- });
- const client = new Discord.Client();
- const token = 'your bot token here';
- client.on('message', message => {
- con.query("INSERT INTO counts (user, channel) VALUES("+ message.author + message.channel + ")", function(){
- });
- });
- client.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement