This commit is contained in:
√(noham)² 2024-01-02 18:17:12 +01:00
parent ab5ac15006
commit d93b308a23
5 changed files with 29 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
config.json

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM python:3.10-alpine
COPY bot.py .
COPY requirements.txt .
COPY config.json .
RUN pip install --no-cache-dir -r requirements.txt
CMD ["python", "-u", "bot.py"]

14
bot.py
View File

@ -227,7 +227,12 @@ TORRENT_OPTOUT_USERS = {}
async def determine_prefix(bot, message):
return CONFIG['bot_prefix']
client = Bot(command_prefix=determine_prefix)
# client = Bot(command_prefix=determine_prefix)
intents = discord.Intents.all()
intents.members = False
client = commands.Bot(command_prefix=determine_prefix, intents=intents)
TSCLIENT = None
MAKE_CLIENT_FAILED = False
@ -1120,7 +1125,12 @@ async def CommandPrecheck(message, whitelist=CONFIG['whitelist_user_ids']):
await asyncio.sleep(2)
await message.delete()
return False
if message.author.id in CONFIG['blacklist_user_ids'] or (len(whitelist) > 0 and message.author.id not in whitelist):
# if message.author.id in CONFIG['blacklist_user_ids'] or (len(whitelist) > 0 and message.author.id not in whitelist):
if message.author.id in CONFIG['blacklist_user_ids'] or (len(whitelist) > 0 and message.author.id in whitelist):
# print(message.author.id in CONFIG['blacklist_user_ids'])
# print(len(whitelist) > 0)
# print(message.author.id not in whitelist)
# print((len(whitelist) > 0 and message.author.id not in whitelist))
await message.channel.send("You're not allowed to use this...")
await asyncio.sleep(2)
await message.delete()

View File

@ -1,6 +1,6 @@
{
"DM_compact_output_user_ids": [],
"blacklist_user_ids": [],
"blacklist_user_ids": [0],
"bot_prefix": "t/",
"bot_token": "BOT-TOKEN",
"delete_command_message_private_torrent": true,

6
requirements.txt Normal file
View File

@ -0,0 +1,6 @@
aiohttp==3.8.6
discord.py==2.3.2
netifaces==0.11.0
pytz==2023.3.post1
Requests==2.31.0
transmissionrpc==0.11