From 256b53678a198d49d154f3f5ad3f6fed873b900c Mon Sep 17 00:00:00 2001 From: Alex Winkler Date: Thu, 20 Oct 2022 16:25:51 +0200 Subject: [PATCH] check if member.name and member.nick are None before using them --- ftsbot/cogs/antispam.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ftsbot/cogs/antispam.py b/ftsbot/cogs/antispam.py index 3e9a70c..79953cd 100644 --- a/ftsbot/cogs/antispam.py +++ b/ftsbot/cogs/antispam.py @@ -94,7 +94,16 @@ async def on_member_join( self, member ): - if 'twitter.com/h0nde' in member.name.lower() or 'twitter.com/h0nde' in member.nick.lower(): + if ( + ( + member.name is not None + and 'twitter.com/h0nde' in member.name.lower() + ) + or ( + member.nick is not None + and 'twitter.com/h0nde' in member.nick.lower() + ) + ): try: await member.ban(reason='Automated ban, spam') except discord.Forbidden: