var Discord = require('discord-client');
var bot = new Discord('token');
bot.setPrefix('global', '!');
bot.command('ping', {response: 'Pong!'});
bot.alias('ping', 'aliasname');
bot.command('prefix', { execute: function(client, msg, args) {
if(msg.channel.permissionsFor(msg.author).hasPermission('MANAGE_GUILD')) {
if(args.length <= 4) {
bot.setPrefix(msg.guild.id, args);
msg.reply('Changed the prefix to `' + args + '`');
} else {
msg.reply('The prefix can\'t be over 4 characters!');
}
} else {
msg.reply('You need the permission `MANAGE_SERVER` to run this!');
}
}
});
bot.connect()