Skip to content
This repository was archived by the owner on Jul 14, 2021. It is now read-only.

Commit 8a44949

Browse files
committed
fix prefix finder ALL MONGO DB NOW!!!
1 parent 791e5b9 commit 8a44949

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

bot.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,14 @@ async def on_message(message):
119119
channel = message.channel
120120

121121
if message.content.lower() in ('whatistheprefix', 'what is the prefix'):
122-
with open('data/config.json') as f:
123-
config = json.load(f)
124-
try:
125-
prefix = config[str(message.guild.id)]['prefix']
126-
except KeyError:
127-
prefix = '-'
128-
await channel.send(f'The guild prefix is `{prefix}`')
122+
result = await db.config.find_one({'_id': str(message.guild.id)})
123+
if not result:
124+
prefix = '-'
125+
try:
126+
prefix = result['prefix']
127+
except KeyError:
128+
prefix = '-'
129+
await channel.send(f'The guild prefix is `{prefix}`')
129130

130131
await bot.process_commands(message)
131132

ffmpeg.exe

38.7 MB
Binary file not shown.

0 commit comments

Comments
 (0)