Check if channel exists before referencing it#342
Conversation
fixes issue #335
There was a problem hiding this comment.
The constant which provides the channel list should be changed here instead of checking it against the server every time
https://github.com/python-discord/seasonalbot/blob/2679849160f160d8f70c597636798df185873523/bot/constants.py#L141-L146
The invalid channel could also be removed from the Channels constants class
Aye, that was my initial reaction as well, however I opted to also check every time as an extra precaution as it seems like this would prevent the issue from popping up in the future (should the channel list change). I've removed the invalid channel #devtest from both |
|
Not sure what the consensus here is about checking it, because the channels don't really change much. |
|
I think I like the idea of just removing the invalid channel (i.e. ba69450).
The underlying problem is a misconfigured / outdated constant. The |
We've come to an agreement on this, and rather than flagging this randomly when users bounce off of a whitelist, it would be better to solve this issue by validating the channel constants on bot startup & logging a warning if any of them fail to resolve so we can identify & update the problematic constant(s). |
|
Hi @neonSea, any interest in updating the implementation here? |
This reverts commit dd6063f.
|
I will implement functionality to check for invalid channels on startup and warn if there are any. Should I create a separate PR for that, or is this one fine? |
name: Check if channel exists before referencing it
about: Avoid referencing #invalid-channel
closes: #335
Pull Request Details
Please ensure your PR fulfills the following criteria:
pipenv run lint)