question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding CacheData.emojis

See original GitHub issue

So it will be good that if you make all emojis from all guilds cache for cache variable! Which will collect all emojis from all guilds. It will be good if you make a getter which will return the cache of all global emojis. This is easy to make but will be good if its built in!

https://github.com/discordeno/discordeno/blob/main/src/api/controllers/cache.ts

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Skillz4Killzcommented, Mar 12, 2021

I think this is a fair request tbh, i’ve myself needed this at times but i also see everyones points as well. In my opinion, perhaps there are some things everyone is not taking into consideration.

Current:

  • guild.emojis is very performant!

Proposed:

  • guild.emojis is still fast but lot slower compared to before. Why because everytime you write guild.emojis, whats actually happening behind the scenes is a massive loops on every single emoji in existance. First it has to iterate and make an array then it has to iterate and filter out emojis not in this guild then create a new collection for the remaining ones.

MY IDEA:

We add a cache.emojis that is a getter that combines all the emojis from all guilds. Emojis therefore remain in guild which keeps guild.emojis optimal! It also allows a cache.emojis when it is desired(i’ve needed thismyself as well so i understand the desire), and it is the best performance wise because you are unlikely to do cache.emojis except when you want all emojis.

0reactions
scientific-devcommented, Mar 14, 2021

Thats what i am actually requesting for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Caching custom emojis from another shard - Stack Overflow
In Discord messages, custom emoji are represented like this: ... any broadcast evals, or anything of the sort: you only need static data....
Read more >
Emojis in Cache Names - Website - Geocaching Forums
When there is an emoji in the middle (or end) of the cache title, everything up to that emoji is displayed correctly. Needless...
Read more >
Emoji Cache: LRU Implementation using Emojis for Identifiers
I'm thinking about usernames, identifiers, etc. Upvote
Read more >
How To Clear Recently Used Emojis on Samsung Keyboard
If you are using Samsung smartphone you may notice that there is no option to clear recently used emoticons. I found easy fix...
Read more >
emojis JavaScript and Node.js code examples - Tabnine
handle(emoji) { emoji.guild.emojis.cache.delete(emoji.id); ... guild.emojis.add(createdEmoji); /** * Emitted whenever a custom emoji is created in a guild.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found