From c90abeb73f45c675b0df940ce8e5138da62b4302 Mon Sep 17 00:00:00 2001 From: nin0dev Date: Mon, 5 Aug 2024 11:17:22 -0400 Subject: [PATCH] help me --- .gitignore | 2 ++ main.py | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .gitignore create mode 100644 main.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2eabec --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.venv +.env \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..c2528c9 --- /dev/null +++ b/main.py @@ -0,0 +1,23 @@ +import discord +from dotenv import load_dotenv +import os + +load_dotenv() + +autoblock_keywords = ["third party", "third-party", "userplugin", "userplugins", "3rd party", "3rd-party", "unofficial", "user plugin", "fps", "free nitro", "screenshare", "screen share", "module", "share"] +channels = [1015060231060983891, 1026515880080842772] +trusted_role = 1026504932959977532 + +class meow(discord.Client): + async def on_ready(self): + print('Logged on as', self.user) + + async def on_message(self, message: discord.Message): + if message.content in autoblock_keywords: + if message.channel.id in channels and trusted_role not in message.author.roles and not message.author.is_friend(): + whk = discord.Webhook.from_url(os.getenv("HOOK")) + await whk.send(embed=discord.Embed(title="Autoblock", description=f"Blocked user {message.author.mention} (ID {str(message.author.id)}). Message:\n```\n{message.content}\n```")) + await message.author.block() + +client = meow() +client.run(os.getenv("TOKEN")) \ No newline at end of file