aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlee14 <Alee14498@gmail.com>2017-07-29 16:31:10 -0400
committerAlee14 <Alee14498@gmail.com>2017-07-29 16:31:10 -0400
commit1650c86452d00339e3738909433f2bb4927514e4 (patch)
treee5dfb58432a4c4fcb79ce23ac56d7839270974e5
parent1714c7e3b119383683af5c5c3e1dd3962e91821a (diff)
downloadAleeBot-1650c86452d00339e3738909433f2bb4927514e4.tar.gz
AleeBot-1650c86452d00339e3738909433f2bb4927514e4.tar.bz2
AleeBot-1650c86452d00339e3738909433f2bb4927514e4.zip
Message content change
-rw-r--r--aleebot.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/aleebot.js b/aleebot.js
index 789e12a..08e4d77 100644
--- a/aleebot.js
+++ b/aleebot.js
@@ -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 :(');
}