Matched up all mismatched 'prefix' and 'prefixes'
This commit is contained in:
parent
181fbec47e
commit
16aa8954cb
2 changed files with 5 additions and 4 deletions
|
@ -259,7 +259,7 @@ class Mod:
|
||||||
@checks.custom_perms(manage_server=True)
|
@checks.custom_perms(manage_server=True)
|
||||||
async def prefix(self, ctx, *, prefix: str):
|
async def prefix(self, ctx, *, prefix: str):
|
||||||
"""This command can be used to set a custom prefix per server"""
|
"""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
|
prefixes[ctx.message.server.id] = prefix
|
||||||
await config.save_content('prefixes', prefixes)
|
await config.save_content('prefixes', prefixes)
|
||||||
await self.bot.say(
|
await self.bot.say(
|
||||||
|
|
|
@ -75,8 +75,9 @@ db_port = global_config.get('db_port', 28015)
|
||||||
# so create a dictionary that we can use to unload to connect
|
# 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}}
|
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'
|
possible_keys = ['prefixes', 'battling', 'battle_records', 'boops', 'server_alerts', 'user_notifications',
|
||||||
'custom_permissions', 'rules', 'overwatch', 'picarto', 'twitch', 'strawpolls', 'tags', 'tictactoe']
|
'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
|
# This will be a dictionary that holds the cache object, based on the key that is saved
|
||||||
cache = {}
|
cache = {}
|
||||||
|
|
||||||
|
@ -90,7 +91,7 @@ def command_prefix(bot, message):
|
||||||
# So assume it's in cache, or it doesn't exist
|
# 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
|
# 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
|
# 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
|
return prefix or default_prefix
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue