mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user