Corrected the order that paramaters were sent to the update record method
This commit is contained in:
parent
8d58b4bb46
commit
50dcecdfc8
1 changed files with 7 additions and 3 deletions
|
@ -94,7 +94,7 @@ cache = {}
|
||||||
# With the new saving method, we're not going to be able to cache the way that I was before
|
# With the new saving method, we're not going to be able to cache the way that I was before
|
||||||
# This is on standby until I rethink how to do this, because I do still want to cache data
|
# This is on standby until I rethink how to do this, because I do still want to cache data
|
||||||
"""for k in possible_keys:
|
"""for k in possible_keys:
|
||||||
cache[k] = Cache(k)"""
|
ca che[k] = Cache(k)"""
|
||||||
|
|
||||||
# We still need 'cache' for prefixes and custom permissions however, so for now, just include that
|
# We still need 'cache' for prefixes and custom permissions however, so for now, just include that
|
||||||
cache['prefixes'] = Cache('prefixes')
|
cache['prefixes'] = Cache('prefixes')
|
||||||
|
@ -149,8 +149,12 @@ async def update_records(key, winner, loser):
|
||||||
winner_stats = {'wins': winner_wins, 'losses': winner_losses, 'rating': winner_rating}
|
winner_stats = {'wins': winner_wins, 'losses': winner_losses, 'rating': winner_rating}
|
||||||
loser_stats = {'wins': loser_wins, 'losses': loser_losses, 'rating': loser_rating}
|
loser_stats = {'wins': loser_wins, 'losses': loser_losses, 'rating': loser_rating}
|
||||||
|
|
||||||
await update_content(key, {'member_id': winner.id}, winner_stats)
|
if not await update_content(key, winner_stats, {'member_id': winner.id}):
|
||||||
await update_content(key, {'member_id': loser.id}, loser_stats)
|
winner_stats['member_id'] = winner.id
|
||||||
|
await add_content(key, winner_stats, {'member_id': winner.id})
|
||||||
|
if not await update_content(key, loser_stats, {'member_id': loser.id}):
|
||||||
|
loser_stats['member_id'] = loser.id
|
||||||
|
await add_content(key, loser_stats, {'member_id': loser.id})
|
||||||
|
|
||||||
|
|
||||||
def command_prefix(bot, message):
|
def command_prefix(bot, message):
|
||||||
|
|
Loading…
Reference in a new issue