Skip to content

Commit

Permalink
🐛 Fix addemoji command
Browse files Browse the repository at this point in the history
  • Loading branch information
Androz2091 committed Jul 28, 2020
1 parent 7524e3b commit 3da8566
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions commands/Administration/addemoji.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ class Addemoji extends Command {
if (!name) {
return message.error("administration/addemoji:MISSING_NAME");
}
if (name.length < 2 || name > 32) {
return message.error("administration/addemoji:INVALID_NAME");
}

message.guild.emojis
.create(URL, name)
.then(emoji => {
message.success("administration/addemoji:SUCCESS", {
emojiName: emoji.name,
emojiString: emoji.toString()
emojiName: emoji.name
});
})
.catch(() => {
message.error("administration/addemoji:ERROR");
message.error("administration/addemoji:ERROR", {
emojiName: name
});
});
}

Expand Down
1 change: 1 addition & 0 deletions languages/en-US/administration/addemoji.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"EXAMPLES": "{{prefix}}addemoji https://via.placeholder.com/150 test-emoji",
"MISSING_URL": "Please provide an image URL!",
"MISSING_NAME": "Please provide an emoji name!",
"INVALID_NAME": "The length of the emoji name must be between 2 and 32!",
"SUCCESS": ":{{emojiName}}: added!",
"ERROR": "{{emojiName}} couldn't be added. Check if your server still has space for new emojis!"
}

0 comments on commit 3da8566

Please sign in to comment.