diff options
| author | Alee14 <Alee14498@gmail.com> | 2017-07-29 16:31:10 -0400 |
|---|---|---|
| committer | Alee14 <Alee14498@gmail.com> | 2017-07-29 16:31:10 -0400 |
| commit | 1650c86452d00339e3738909433f2bb4927514e4 (patch) | |
| tree | e5dfb58432a4c4fcb79ce23ac56d7839270974e5 | |
| parent | 1714c7e3b119383683af5c5c3e1dd3962e91821a (diff) | |
| download | AleeBot-1650c86452d00339e3738909433f2bb4927514e4.tar.gz AleeBot-1650c86452d00339e3738909433f2bb4927514e4.tar.bz2 AleeBot-1650c86452d00339e3738909433f2bb4927514e4.zip | |
Message content change
| -rw-r--r-- | aleebot.js | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -133,6 +133,13 @@ function wordFilter(content) { } */ client.on("message", function(message){ + if (message.author.bot) return; + if (!message.content.startsWith(prefix)) return; + + let command = message.content.split(" ")[0]; + command = command.slice(prefix.length); + + let args = message.content.split(" ").slice(1); /* if (wordFilter(message.content)) { message.delete(); @@ -143,7 +150,7 @@ client.on("message", function(message){ message.author.send("You have been caught swearing in AleeArmy Community."); } */ - if (message.content === prefix + 'help'){ + if (command === 'help'){ var embed = new Discord.RichEmbed() .addField('Commands for AleeBot!\n\n', '**'+prefix+'profile** Shows your profile pic in a image\n' + @@ -156,24 +163,24 @@ client.on("message", function(message){ message.channel.sendEmbed(embed); } - if(message.content === prefix + 'profile'){ + if(command === 'profile'){ message.reply(message.author.avatarURL); } - if(message.content === prefix + 'git'){ + if(command === 'git'){ message.channel.send ('Here is the github repo: https://github.com/AleeCorp/AleeBot'); } - if(message.content === prefix + 'ping'){ + if(command === 'ping'){ message.reply('Pong! :ping_pong:'); } - if(message.content === prefix + 'owner'){ + if(command === 'owner'){ message.channel.send ('The person who made this is Alee14#9928!'); } - if(message.content === prefix + 'suggest'){ + if(command === 'suggest'){ message.reply('Sorry this feature is still being worked on :('); } |
