1
0
Fork 0
mirror of synced 2024-10-01 01:36:27 +13:00

Remove erroneous instance of guild

This commit is contained in:
phxntxm 2017-03-17 01:12:16 -05:00
parent 8386923199
commit fcc8cc0bbe
2 changed files with 2 additions and 2 deletions

2
bot.py
View file

@ -65,7 +65,7 @@ async def process_command(ctx):
command_usage['member_usage'] = total_member_usage
# Add one to the server's usage for this command
if ctx.message.guild is not None:
if ctx.message.server is not None:
total_server_usage = command_usage.get('server_usage', {})
server_usage = total_server_usage.get(server.id, 0) + 1
total_server_usage[server.id] = server_usage

View file

@ -116,7 +116,7 @@ def command_prefix(bot, message):
# But it is not worth a query for every single message the bot detects, to fix
try:
prefixes = cache['server_settings'].values
prefix = [x for x in prefixes if x['server_id'] == message.guild.id][0]['prefix']
prefix = [x for x in prefixes if x['server_id'] == message.server.id][0]['prefix']
return prefix or default_prefix
except (KeyError, TypeError, IndexError, AttributeError):
return default_prefix