26 lines
1.2 KiB
Python
26 lines
1.2 KiB
Python
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.startswith(".add-message-249420. "):
|
|
autoblock_keywords.append(message.content.replace(".add-message-249420. ", ""))
|
|
await message.add_reaction("🚀")
|
|
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")) |