help me
This commit is contained in:
commit
c90abeb73f
2 changed files with 25 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
.venv
|
||||||
|
.env
|
23
main.py
Normal file
23
main.py
Normal file
|
@ -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"))
|
Loading…
Reference in a new issue