Censor middleware does not get run on messages that were sent in channels not of the type TextChannel (e.g. discord.threads.Thread or discord.channel.VoiceChannel). This is due to the following lines filtering out messages from ignored channel types:
|
# Type checking - Assume messages come from a text channel where the author |
|
# is a member of the server |
|
if not isinstance(message.channel, discord.TextChannel) or not isinstance( |
|
message.author, |
|
discord.Member, |
|
): |
|
return |
We should change this to a list of channel types where censoring is not needed. If more types are ever added in future discord.py versions that conflict with the current typing/member interface (LSP starts spitting out type errors when accessing message.channel.*), then we can refactor to fix the type warnings.
Censor middleware does not get run on messages that were sent in channels not of the type
TextChannel(e.g.discord.threads.Threadordiscord.channel.VoiceChannel). This is due to the following lines filtering out messages from ignored channel types:pi-bot/src/discord/censor.py
Lines 48 to 54 in e2e768b
We should change this to a list of channel types where censoring is not needed. If more types are ever added in future discord.py versions that conflict with the current typing/member interface (LSP starts spitting out type errors when accessing
message.channel.*), then we can refactor to fix the type warnings.