mirror of
https://github.com/danbulant/discord.js
synced 2026-05-30 12:51:55 +00: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:
parent
b83fdbfefe
commit
cd58599caf
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue