Merge pull request #1 from Javi3rV/patch-1

Update AntiScam.py
This commit is contained in:
H3cJP 2021-12-26 16:04:36 +01:00 committed by GitHub
commit 76fc303f8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ async def AntiScam(message, bot, whitelist, muted_role, verified_role, logs_chan
global message_content, last_message, last_message_content, spam_counter global message_content, last_message, last_message_content, spam_counter
message_content = f'{message.author.id}: {message.content}' message_content = f'{message.author.id}: {message.content}'
message_content = message_content.replace("'", "`") message_content = message_content.replace("'", "`")
mentions = message.raw_mentions
# AntiScam-System # AntiScam-System
if message_content == last_message_content and message.content != '' and message.author.id not in whitelist: if message_content == last_message_content and message.content != '' and message.author.id not in whitelist:
spam_counter += 1 spam_counter += 1
@ -20,7 +20,7 @@ async def AntiScam(message, bot, whitelist, muted_role, verified_role, logs_chan
last_message_content = message_content last_message_content = message_content
spam_counter = 0 spam_counter = 0
if len(message.mentions) > 10 and message.author.id not in whitelist: if len(mentions) > 10 and message.author.id not in whitelist:
await message.delete() await message.delete()
spam_counter = 2 spam_counter = 2
@ -33,4 +33,4 @@ async def AntiScam(message, bot, whitelist, muted_role, verified_role, logs_chan
await message.author.remove_roles(verified) await message.author.remove_roles(verified)
channel = bot.get_channel(logs_channel) channel = bot.get_channel(logs_channel)
await channel.send(f'USUARIO MUTEADO: {message_content}') await channel.send(f'USUARIO MUTEADO: {message_content}')
await bot.process_commands(message) await bot.process_commands(message)