Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Emoji#url getter is deprecated. Use Emoji#imageURL() instead. #10024

Closed
theredcmdcraft opened this issue Dec 3, 2023 · 3 comments · Fixed by #10025
Closed

The Emoji#url getter is deprecated. Use Emoji#imageURL() instead. #10024

theredcmdcraft opened this issue Dec 3, 2023 · 3 comments · Fixed by #10025

Comments

@theredcmdcraft
Copy link

Which package is this bug report for?

discord.js

Issue description

  1. Calling function guild.emojis.cache e.g. in console.log or somewhere else
  2. the error below will appear in the console:
The Emoji#url getter is deprecated. Use Emoji#imageURL() instead.
DeprecationWarning: The Emoji#url getter is deprecated. Use Emoji#imageURL() instead.
    at get url [as url] ([Project Path]\node_modules\discord.js\src\structures\Emoji.js:63:15)
    at flatten ([Project Path]\node_modules\discord.js\src\util\Util.js:32:24)
    at GuildEmoji.toJSON ([Project Path]\node_modules\discord.js\src\structures\Base.js:35:12)
    at GuildEmoji.toJSON ([Project Path]\node_modules\discord.js\src\structures\Emoji.js:105:18)
    at JSON.stringify (<anonymous>)
    at GuildInsertHandler.update ([Project Path]\Utils\Handler\GuildInsertHandler.js:94:52)
    at ChannelUpdateEvent.main ([Project Path]\Events\Discord\Guild\Channel\ChannelUpdateEvent.js:22:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Code sample

const bot = new Discord.Client(...);

bot.on("ready", (client) => {
    client.guilds.forEach((guild) => {
        console.log(guild.emojis.cache)
    })
});


bot.login(token).catch((e) => {console.log(e)})

Versions

nodejs version: v20.10.0
npm: v9.9.2 also in v10.2.4
discordjs: version 14.14.1

Issue priority

Medium (should be fixed soon)

Which partials do you have configured?

User, GuildMember, Message

Which gateway intents are you subscribing to?

Guilds, GuildMembers, GuildVoiceStates, GuildPresences, GuildMessages, MessageContent

I have tested this issue on a development release

No response

@Jiralite
Copy link
Member

Jiralite commented Dec 3, 2023

Cannot reproduce this.

What are you actually doing, because your code sample is invalid?

@theredcmdcraft
Copy link
Author

Okay i`ve not testet it, ive wrote the relevant thing. i will correct it tomorrow.

@jaw0r3k
Copy link
Contributor

jaw0r3k commented Dec 3, 2023

Actual code sample

const emoji = new Emoji(/** client instance */, { id: "123456789", name: "somename" })
console.log(emoji.toJSON())

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants