Skip to content

Commit

Permalink
fix(Guild#deleteEmoji): reject non emojis / emoji IDs (#2793)
Browse files Browse the repository at this point in the history
* fix(Guild#deleteEmoji): Performing wrong checks

* fix: requested changes

`a string` -> `an id`

* fix: requested changes

`id` -> `ID`
  • Loading branch information
kyranet authored and SpaceEEC committed Aug 29, 2018
1 parent b83fdbf commit cd58599
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,8 @@ class Guild {
* @returns {Promise}
*/
deleteEmoji(emoji, reason) {
if (!(emoji instanceof Emoji)) emoji = this.emojis.get(emoji);
if (typeof emoji === 'string') emoji = this.emojis.get(emoji);
if (!(emoji instanceof Emoji)) throw new TypeError('Emoji must be either an instance of Emoji or an ID');
return this.client.rest.methods.deleteEmoji(emoji, reason);
}

Expand Down

0 comments on commit cd58599

Please # to comment.