diff options
| author | 2024-06-01 00:03:05 +0100 | |
|---|---|---|
| committer | 2024-06-01 00:03:05 +0100 | |
| commit | 85808c2502a10814cff514ab69c7742d21207d21 (patch) | |
| tree | 3a8d5d1251e5b2883235cadc000deeb444481752 /arthur/exts/systems/system_information.py | |
| parent | Merge pull request #198 from python-discord/system-software-interaction (diff) | |
Explicit member check to avoid webhook errors
Diffstat (limited to 'arthur/exts/systems/system_information.py')
| -rw-r--r-- | arthur/exts/systems/system_information.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arthur/exts/systems/system_information.py b/arthur/exts/systems/system_information.py index fddfacc..0e8c844 100644 --- a/arthur/exts/systems/system_information.py +++ b/arthur/exts/systems/system_information.py @@ -4,7 +4,7 @@ import random from datetime import datetime import aiohttp -from discord import Message +from discord import Member, Message from discord.ext.commands import Cog, Context, command from loguru import logger @@ -73,9 +73,10 @@ class SystemInformation(Cog): msg_thresh = THRESHOLD - if CONFIG.devops_role not in (r.id for r in msg.author.roles): - logger.trace("Upping threshold due to non-DevOps member") - msg_thresh *= 10 + if isinstance(msg.author, Member): + if CONFIG.devops_role not in (r.id for r in msg.author.roles): + logger.trace("Upping threshold due to non-DevOps member") + msg_thresh *= 10 if len(msg.content) > BLOG_ABOUT_IT_THRESHOLD: msg_thresh += 0.10 |