Red-discordbot: is_automod_immune raises error on webhook messages

Created on 20 Dec 2018  路  3Comments  路  Source: Cog-Creators/Red-DiscordBot

Other bugs

What were you trying to do?

Checking is_automod_immune inside on_message with a webhook message update.

What were you expecting to happen?

is_automod_immune would return True or False depending on who sent the message.

What actually happened?

is_automod_immune raised AttributeError: 'User' object has no attribute 'roles' after a webhook message was sent.

How can we reproduce this issue?

Check is_automod_immune on incoming webhook messages.

Bug

Most helpful comment

This is very easily remedied, the question is should webhooks be considered automod immune though? My 2c is yes since they require manage_server to set up.

All 3 comments

This is very easily remedied, the question is should webhooks be considered automod immune though? My 2c is yes since they require manage_server to set up.

I'm going through our other methods which take a message, context, or author to ensure they don't run into the same issue, PR in a moment with them being considered immune from moderation actions, behavior on that can be changed if desired.

Resolved by #2337.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LGACode picture LGACode  路  4Comments

P4rtyguy picture P4rtyguy  路  4Comments

Kowlin picture Kowlin  路  4Comments

SieBrum picture SieBrum  路  3Comments

clovisd picture clovisd  路  3Comments