Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Discord = require('discord.io');
- var logger = require('winston');
- var auth = require('./auth.json');
- // Configure logger settings
- logger.remove(logger.transports.Console);
- logger.add(logger.transports.Console, {
- colorize: true
- });
- logger.level = 'debug';
- // Initialize Discord Bot
- var bot = new Discord.Client({
- token: auth.token,
- autorun: true
- });
- bot.on('ready', function (evt) {
- logger.info('Connected');
- logger.info('Logged in as: ');
- logger.info(bot.username + ' - (' + bot.id + ')');
- });
- bot.on('message', function (user, userID, channelID, message, evt) {
- // Our bot needs to know if it will execute a command
- // It will listen for messages that will start with `!`
- if (message.substring(0, 1) == '@PVE') {
- var args = message.substring(1).split(' ');
- var cmd = args[0];
- args = args.splice(1);
- switch(cmd) {
- // @PVE
- case 'PVE':
- bot.sendMessage({
- to: channelID,
- message: 'Fuck you @IrishRebelA07#7394'
- });
- break;
- // Just add any case commands if you want to..
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement