11import asyncio
22import glob
33import io
4- import logging
54import json
5+ import logging
66import math
77import os
88import random
@@ -139,7 +139,7 @@ def __init__(self, bot):
139139 'Not specified' ,
140140 '???' ,
141141 'Reply hazy' ,
142- 'Most likely'
142+ 'Most likely' ,
143143 ]
144144
145145 self .INDEX , self .EMOTES = (0 , 1 )
@@ -1533,7 +1533,7 @@ async def _profile_revoke(
15331533 return await msg .edit (
15341534 content = f'{ config .greenTick } { item .title ()} `{ name } ` revoked from { len (users ) - failCount } /{ len (users )} member(s).'
15351535 )
1536-
1536+
15371537 @commands .group (name = 'migratefavgames' , invoke_without_command = True )
15381538 async def _migratefavgames (self , ctx ):
15391539 if ctx .author .id not in [
@@ -1547,8 +1547,8 @@ async def _migratefavgames(self, ctx):
15471547 game_lookup = json .load (f )
15481548
15491549 db = mclient .bowser .users
1550-
1551- query = { "favgames" : { '$exists' : True , '$not' : { '$size' : 0 } } }
1550+
1551+ query = {"favgames" : {'$exists' : True , '$not' : {'$size' : 0 }} }
15521552 count = db .count_documents (query )
15531553 users = db .find (query )
15541554
@@ -1571,10 +1571,10 @@ async def _migratefavgames(self, ctx):
15711571
15721572 # giantbomb id unknown
15731573 if game not in game_lookup :
1574- new_games [i ] = game # keep the giantbomb id
1574+ new_games [i ] = game # keep the giantbomb id
15751575 new_id_cache [game ] = game
15761576 continue
1577-
1577+
15781578 names = game_lookup [game ]
15791579
15801580 score = 0
@@ -1587,7 +1587,7 @@ async def _migratefavgames(self, ctx):
15871587 deku_id = search ['deku_id' ]
15881588
15891589 if not deku_id :
1590- new_games [i ] = game # keep the giantbomb id
1590+ new_games [i ] = game # keep the giantbomb id
15911591 new_id_cache [game ] = game
15921592 continue
15931593
@@ -1598,8 +1598,8 @@ async def _migratefavgames(self, ctx):
15981598 db .update_one ({'_id' : user ['_id' ]}, {'$set' : {'favgames' : new_games }}, upsert = True )
15991599
16001600 # update the progress message
1601- interval = (count // 100 )+ 1
1602- if ((( j + 1 ) % interval ) == 0 ) :
1601+ interval = (count // 100 ) + 1
1602+ if (( j + 1 ) % interval ) == 0 :
16031603 await message .edit (content = f'Migrating... { j + 1 } /{ count } ' )
16041604
16051605 await message .edit (content = f'Migrating... { count } /{ count } ' )
0 commit comments