Skip to content

Commit

Permalink
Update bot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
IUseDebianBtw authored Sep 18, 2023
1 parent 8c0bdc6 commit 705e5b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import datetime

TOKEN = 'your_bot_token'
# change the whitelisted server ids to all to log all servers, if not just add the server id
WHITELISTED_SERVER_IDS = [12345679, 123465976]

client = discord.Client()
Expand All @@ -16,7 +17,7 @@ async def on_message(message):
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')

if message.guild:
if message.guild.id in WHITELISTED_SERVER_IDS:
if WHITELISTED_SERVER_IDS == 'all' or message.guild.id in WHITELISTED_SERVER_IDS:
server_folder = f'/path/to/dir/{message.guild.id}'
os.makedirs(server_folder, exist_ok=True)
channel_file = f'{server_folder}/{message.channel.name}.md'
Expand Down

0 comments on commit 705e5b0

Please sign in to comment.