Skip to content

Commit

Permalink
check if member.name and member.nick are None before using them
Browse files Browse the repository at this point in the history
  • Loading branch information
FO-nTTaX committed Oct 20, 2022
1 parent bff1638 commit 256b536
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ftsbot/cogs/antispam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 256b536

Please sign in to comment.