Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Config = {};
- function checkMessageForCommand(msg, isEdit) {
- //check if message is a command
- if(msg.author.id != bot.user.id && (msg.content.startsWith(Config.commandPrefix))){
- console.log("treating " + msg.content + " from " + msg.author + " as command");
- var cmdTxt = msg.content.split(" ")[0].substring(Config.commandPrefix.length);
- var suffix = msg.content.substring(cmdTxt.length+Config.commandPrefix.length+1);//add one for the ! and one for the space
- if(msg.isMentioned(bot.user)){
- try {
- cmdTxt = msg.content.split(" ")[1];
- suffix = msg.content.substring(bot.user.mention().length+cmdTxt.length+Config.commandPrefix.length+1);
- } catch(e){ //no command
- msg.channel.sendMessage("Yes?");
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement