1
0
Fork 0
mirror of synced 2024-06-29 03:30:57 +12:00

Matched up all mismatched 'prefix' and 'prefixes'

This commit is contained in:
phxntxm 2016-08-31 14:17:33 -05:00
parent 181fbec47e
commit 16aa8954cb
2 changed files with 5 additions and 4 deletions

View file

@ -259,7 +259,7 @@ class Mod:
@checks.custom_perms(manage_server=True)
async def prefix(self, ctx, *, prefix: str):
"""This command can be used to set a custom prefix per server"""
prefixes = await config.get_content('prefix')
prefixes = await config.get_content('prefixes')
prefixes[ctx.message.server.id] = prefix
await config.save_content('prefixes', prefixes)
await self.bot.say(

View file

@ -75,8 +75,9 @@ db_port = global_config.get('db_port', 28015)
# so create a dictionary that we can use to unload to connect
db_opts = {'host': db_host, 'db': db_name, 'port': db_port, 'ssl': {'ca_certs': db_cert}}
possible_keys = ['prefix', 'battling', 'battle_records', 'boops', 'server_alerts', 'user_notifications', 'nsfw_channels'
'custom_permissions', 'rules', 'overwatch', 'picarto', 'twitch', 'strawpolls', 'tags', 'tictactoe']
possible_keys = ['prefixes', 'battling', 'battle_records', 'boops', 'server_alerts', 'user_notifications',
'nsfw_channels', 'custom_permissions', 'rules', 'overwatch', 'picarto', 'twitch', 'strawpolls', 'tags',
'tictactoe']
# This will be a dictionary that holds the cache object, based on the key that is saved
cache = {}
@ -90,7 +91,7 @@ def command_prefix(bot, message):
# So assume it's in cache, or it doesn't exist
# If the prefix does exist in the database and isn't in our cache; too bad, something has messed up
# But it is not worth a query for every single message the bot detects, to fix
prefix = cache['prefix'].values.get(message.server.id)
prefix = cache['prefixes'].values.get(message.server.id)
return prefix or default_prefix