Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

synzieeeee

a guest Feb 19th, 2018 55 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. var Discord = require('discord.io');
  2. var logger = require('winston');
  3. var auth = require('./auth.json');
  4. logger.remove(logger.transports.Console);
  5. logger.add(logger.transports.Console, {
  6.     colorize: true
  7. });
  8. logger.level = 'debug';
  9. var bot = new Discord.Client({
  10.    token: auth.token,
  11.    autorun: true
  12. });
  13. bot.on('ready', function (evt) {
  14.     logger.info('Connected');
  15.     logger.info('Logged in as: ');
  16.     logger.info(bot.username + ' - (' + bot.id + ')');
  17. });
  18. bot.on('message', function (user, userID, channelID, message, evt) {
  19.     if (message.substring(0, 1) == '!') {
  20.         var args = message.substring(1).split(' ');
  21.         var cmd = args[0];
  22.        
  23.         args = args.splice(1);
  24.         switch(cmd) {
  25.             // !ping
  26.             case 'ping':
  27.                 bot.sendMessage({
  28.                     to: channelID,
  29.                     message: 'Pong!'
  30.                 });
  31.             break;
  32.          }
  33.      }
  34. });
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