mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 10:54:44 +12:00
fix: replace internal calls to Emoji#url (#10025)
This commit is contained in:
parent
54453b04e5
commit
941642ad2f
2 changed files with 5 additions and 4 deletions
|
@ -139,7 +139,7 @@ class RoleManager extends CachedManager {
|
|||
color &&= resolveColor(color);
|
||||
if (permissions !== undefined) permissions = new PermissionsBitField(permissions);
|
||||
if (icon) {
|
||||
const guildEmojiURL = this.guild.emojis.resolve(icon)?.url;
|
||||
const guildEmojiURL = this.guild.emojis.resolve(icon)?.imageURL();
|
||||
icon = guildEmojiURL ? await DataResolver.resolveImage(guildEmojiURL) : await DataResolver.resolveImage(icon);
|
||||
if (typeof icon !== 'string') icon = undefined;
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ class RoleManager extends CachedManager {
|
|||
|
||||
let icon = options.icon;
|
||||
if (icon) {
|
||||
const guildEmojiURL = this.guild.emojis.resolve(icon)?.url;
|
||||
const guildEmojiURL = this.guild.emojis.resolve(icon)?.imageURL();
|
||||
icon = guildEmojiURL ? await DataResolver.resolveImage(guildEmojiURL) : await DataResolver.resolveImage(icon);
|
||||
if (typeof icon !== 'string') icon = undefined;
|
||||
}
|
||||
|
|
|
@ -102,12 +102,13 @@ class Emoji extends Base {
|
|||
}
|
||||
|
||||
toJSON() {
|
||||
return super.toJSON({
|
||||
const json = super.toJSON({
|
||||
guild: 'guildId',
|
||||
createdTimestamp: true,
|
||||
url: true,
|
||||
identifier: true,
|
||||
});
|
||||
json.imageURL = this.imageURL();
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue