diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d344ba6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8bc5085 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/bot.py b/bot.py index 01c9946..3f19416 100644 --- a/bot.py +++ b/bot.py @@ -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() diff --git a/config-sample.json b/config-sample.json index 62309b0..1b961c5 100644 --- a/config-sample.json +++ b/config-sample.json @@ -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, diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3c3a2f8 --- /dev/null +++ b/requirements.txt @@ -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