fix(Guild#deleteEmoji): reject non emojis / emoji IDs (#2793)

* fix(Guild#deleteEmoji): Performing wrong checks

* fix: requested changes

`a string` -> `an id`

* fix: requested changes

`id` -> `ID`
This commit is contained in:
Kyra
2018-08-29 08:45:27 +02:00
committed by SpaceEEC
parent b83fdbfefe
commit cd58599caf

View File

@@ -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);
}