Problems after having 2 shards
TypeError: Cannot read properties of undefined (reading 'channels')
My bot now uses two shards, so it's also running the ready event twice. What's a fix for this?11 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
What is this code supposed to be doing? Guilds only exist on a single shard, that's the point
It's supposed to get a channel from a server the bot is in
Well that server is only going to be on one of the shards
So what am I supposed to do instead?
You haven't explained why it needs to do this
To update the channel (category)'s name
And your bot needs to do this every time it starts?
It does it every 10 minutes approx
Yikes
Well anyway, I'd just check if
server
is defined
That way it'll only be running on the shard it's meant to
Stuff like this is going to continue to cause problems as you scale the bot up thoughThen I probably shouldn't do that? 😅