Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // removed Network Discord Bot
- // Created by LamboCreeper
- // Written in JavaScript
- // Using DiscordJS and NodeJS.
- const Discord = require('discord.js');
- const client = new Discord.Client();
- // Connect to MySQL database
- var mysql = require('mysql');
- var connection = mysql.createConnection({
- host: '',
- user: '',
- password: '',
- database: '',
- });
- connection.connect(function(err){
- if(err){
- console.log('error');
- }else{
- console.log('connected');
- }
- });
- client.on('ready', () => {
- console.log('I am ready!');
- client.user.setGame("")
- });
- client.on('message', message => {
- // Help Commands
- if (message.content === '/sql_test') {
- connection.connect();
- connection.query("SELECT * FROM lambo", function(eer, rows, fields) {
- if (eer) throw err;
- message.reply(rows);
- });
- connection.end();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement