Improve robustness of `is_channel_sendable()`
Residing in util/channels.py
, this method is described by the docstring as serving the function of:
[Testing] for permission to send messages in a given channel.
Presently, its logic includes:
Channel object must be one of type TextChannel, VoiceChannel, Thread, or DMChannel.
Returns the channel on success,
None
for unknown, and otherwiseFalse
.
I'd like to improve this to:
Channel object must be one of:
[TextChannel, VoiceChannel, Thread, DMChannel]
Returns the channel object on success, otherwise
False
, or raisesTypeError
.
Doing so would make it more robust as far as error and fallback handling is concerned.
Edited by erin