aboutsummaryrefslogtreecommitdiff
path: root/cogs/utils.py
diff options
context:
space:
mode:
authorAnInternetTroll <lucafulger@gmail.com>2021-10-21 17:07:47 +0000
committerAnInternetTroll <lucafulger@gmail.com>2021-10-21 17:07:47 +0000
commit8aef450557a9595d5dccbe2c0c24e0997fcde905 (patch)
tree9a81fe3859aeba779e6ae2cf20f7b29f3faecd0a /cogs/utils.py
parentb5cbbfdb167f448d5e5929ced8f2b7f09e1bbb41 (diff)
downloadsteve-bot-8aef450557a9595d5dccbe2c0c24e0997fcde905.tar
steve-bot-8aef450557a9595d5dccbe2c0c24e0997fcde905.tar.gz
steve-bot-8aef450557a9595d5dccbe2c0c24e0997fcde905.tar.bz2
steve-bot-8aef450557a9595d5dccbe2c0c24e0997fcde905.tar.lz
steve-bot-8aef450557a9595d5dccbe2c0c24e0997fcde905.tar.xz
steve-bot-8aef450557a9595d5dccbe2c0c24e0997fcde905.tar.zst
steve-bot-8aef450557a9595d5dccbe2c0c24e0997fcde905.zip
Merge #59 with the added change of 2 messages before spam is triggered
Diffstat (limited to 'cogs/utils.py')
-rwxr-xr-xcogs/utils.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/cogs/utils.py b/cogs/utils.py
index aae246f..d11a2e8 100755
--- a/cogs/utils.py
+++ b/cogs/utils.py
@@ -407,6 +407,32 @@ class Utils(commands.Cog):
)
if "women" in text.lower() or "woman" in text.lower():
await message.channel.send("<:shut:808843657167765546>")
+ if message.reference is not None and len(message.content) == 0:
+ reply = await message.channel.fetch_message(message.reference.message_id)
+ if reply.is_system():
+ def check(m):
+ return (
+ m.author == message.author
+ and message.reference is not None
+ and len(message.content) == 0
+ )
+
+ try:
+ msg2 = await self.bot.wait_for("message", check=check)
+ except asyncio.TimeoutError:
+ return
+ reply2 = await msg2.channel.fetch_message(msg2.reference.message_id)
+ if not reply2.is_system():
+ return
+ muted_role = message.guild.get_role(
+ int(self.bot.config[str(message.guild.id)]["mute_role"])
+ )
+ await message.author.add_roles(muted_role, reason="spam")
+ await message.channel.send(
+ "{0.mention} has been muted for *spam*".format(message.author)
+ )
+ await asyncio.sleep(300)
+ await message.author.remove_roles(muted_role, reason="time's up ")
for word in badWords:
if word in message.content.lower().replace(" ", ""):
@@ -756,3 +782,4 @@ class Utils(commands.Cog):
def setup(bot):
bot.add_cog(Utils(bot))
+