Can two shards have the same guild in the guild cache?
This may seem like a dumb question, but it's genuine; I believe I am having a scenario where two shards have the same guild. ping on reply
25 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Yes, if you manually fetch the guild
interesting, is there any other way? (I ask because I don't believe I am doing that, but I will double check to confirm)
A way to get a guild?
I don't think you can get the guild in your main process, but you can do whatever you want in broadcast eval
I mean is there any other way a guild, not assigned to the shard, to get into the shard's guild cache
I'm not sure if fetch is good there. There's cache option to prevent caching new fetched structures. I'd prefer to use broadcast eval.
I might not be explaining my question right. Basically, I have a situation where two shards have the same guild (I don't want this) and I am not sure how it happened
I don't really ever fetch specific guilds
It shouldn't happen on its own, no
Hmm, I am going to keep investigating and follow up here. If there is a bug causing this it could be specific to big bots
can duplicates exist in the cache?
Of one shard? no
Well, unless you managed to manually store an entire guild object under the wrong id but that would mess up so much more
yea but on start up there would never be duplicates right?
correct
welp, I don't know what the else could be causing my issue so I am going to add some logging to ensure this isn't the case (this is from a job that runs when the bot finishes logging in):
![No description](https://cdn.answeroverflow.com/1209035612611420241/image.png)
The cache is already a map