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

Failing to get channel to update webhook #22

Open
irismessage opened this issue Jan 14, 2025 · 1 comment
Open

Failing to get channel to update webhook #22

irismessage opened this issue Jan 14, 2025 · 1 comment

Comments

@irismessage
Copy link

It's adding a watch and removing the watch fine but when it tries to run printer it gets this error:

Jan 14 18:44:33 ubuntu-32gb-ash-1 python[1344261]: [2025-01-14 18:44:33] [ERROR] red.wizard-cogs.gameserverstatus: Error happened while trying to execute gameserverstatus loop.
Jan 14 18:44:33 ubuntu-32gb-ash-1 python[1344261]: Traceback (most recent call last):
Jan 14 18:44:33 ubuntu-32gb-ash-1 python[1344261]:   File "/home/red/.local/share/Red-DiscordBot/data/ImpstationRed/cogs/CogManager/cogs/gameserverstatus/gameserverstatus.py", line 528, in printer
Jan 14 18:44:33 ubuntu-32gb-ash-1 python[1344261]:     msg: Message = await channel.fetch_message(msg_id)
Jan 14 18:44:33 ubuntu-32gb-ash-1 python[1344261]:                          ^^^^^^^^^^^^^^^^^^^^^
Jan 14 18:44:33 ubuntu-32gb-ash-1 python[1344261]: AttributeError: 'NoneType' object has no attribute 'fetch_message'

the channel exists and the bot can access it but it's not in the cache. for some reason it only happens on one server I use but it's probably cache semantics. adding a check if the channel is None and then a fetch_channel fallback should fix it, e.g. see here Rapptz/discord.py#7293

@irismessage
Copy link
Author

irismessage commented Jan 14, 2025

yeah, I did this and it works now master...irismessage:wizard-cogs:master
still weird I only got that bug on one specific discord server though

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

No branches or pull requests

1 participant