#Can't get guild with get_guild

1 messages · Page 1 of 1 (latest)

worthy ginkgo
#

Hello, I have a problem. For some reason, I can't get a specific guild using get_guild in the on_ready event. This does not work only with a certain guild, I can get another one. I noticed that it only doesn't work in on_ready, inside a slash command I can get any guild via get_guild.
Here is what bot.guilds returns

weak shale
#

You shouldn't really be doing anything that involves getting data from the API or from the bot's cache in on_ready.

worthy ginkgo
#

That was an example. In reality, I need to get guild in loop task. What am i doing wrong here?

weak shale
#

Do you have intent.guilds = True? If not, then guilds aren't being cached. Is server_id for sure an int and the correct server ID?

worthy ginkgo
#

Yes i have. Yes, it is an int

ornate helm
#

put a sleep on it or something before checking guild

#

cached etc

ornate helm
#

@worthy ginkgoput a sleep like 1min

#

that will make it fetch guild

weak shale
# ornate helm This !

They're doing it in a task within a cog. They have the @before. with wait_until_ready()

worthy ginkgo
#

Well, the problem resolved itself... I was afk for like 1h, and this works now