@@ -194,14 +194,14 @@ async def _games_search(self, interaction: discord.Interaction, query: str):
194194 embed = discord .Embed (
195195 title = game ['name' ],
196196 url = f"{ game ['deku_link' ]} ?{ DEKU_UTM } &utm_content=mechabowser-game-search" ,
197- timestamp = self .get_db_last_update ()
197+ timestamp = self .get_db_last_update (),
198198 )
199199 embed .set_footer (text = f'Data last fetched' )
200200
201201 embed .set_author (
202202 name = 'Data provided by DekuDeals' ,
203203 url = f'https://www.dekudeals.com/games?{ DEKU_UTM } &utm_content=mechabowser-game-search' ,
204- icon_url = 'https://www.dekudeals.com/favicon-32x32.png'
204+ icon_url = 'https://www.dekudeals.com/favicon-32x32.png' ,
205205 )
206206
207207 if game ['image' ]:
@@ -219,12 +219,11 @@ async def _games_search(self, interaction: discord.Interaction, query: str):
219219 dates ["Switch 2" ] = game ["release_date" ]["switch_2" ].date ()
220220 elif 'switch_2' in game ['_last_synced' ]:
221221 dates ["Switch 2" ] = "*Unknown*"
222-
222+
223223 lines = []
224224 for platform , date in dates .items ():
225225 lines .append (f"{ platform } : { date } " )
226226
227-
228227 s = "" if len (dates ) == 1 else "s"
229228 embed .add_field (name = f'Release Date{ s } ' , value = "\n " .join (lines ), inline = False )
230229
@@ -233,18 +232,18 @@ async def _games_search(self, interaction: discord.Interaction, query: str):
233232 prices = {}
234233
235234 if "switch_1" in game ["eshop_price" ] and game ["eshop_price" ]["switch_1" ]:
236- if "us" in game ["eshop_price" ]["switch_1" ] and game ["eshop_price" ]["switch_1" ]["us" ]:
235+ if "us" in game ["eshop_price" ]["switch_1" ] and game ["eshop_price" ]["switch_1" ]["us" ]:
237236 prices ["Switch" ] = game ["eshop_price" ]["switch_1" ]["us" ]
238237
239238 if "switch_2" in game ["eshop_price" ] and game ["eshop_price" ]["switch_2" ]:
240- if "us" in game ["eshop_price" ]["switch_2" ] and game ["eshop_price" ]["switch_2" ]["us" ]:
239+ if "us" in game ["eshop_price" ]["switch_2" ] and game ["eshop_price" ]["switch_2" ]["us" ]:
241240 prices ["Switch 2" ] = game ["eshop_price" ]["switch_2" ]["us" ]
242-
241+
243242 lines = []
244243 for platform , price in prices .items ():
245- msrp = price ['msrp' ]/ 100
246- curr = price ['price' ]/ 100
247-
244+ msrp = price ['msrp' ] / 100
245+ curr = price ['price' ] / 100
246+
248247 if curr < msrp :
249248 lines .append (f"{ platform } : ~~${ msrp :.2f} ~~ ${ curr :.2f} " )
250249 else :
@@ -267,11 +266,11 @@ async def _games_search(self, interaction: discord.Interaction, query: str):
267266
268267 else :
269268 return await interaction .followup .send (f'{ config .redTick } No results found.' )
270-
269+
271270 def get_db_last_update (self ):
272271 if self .last_sync ['at' ]:
273272 return self .last_sync ['at' ]
274-
273+
275274 else :
276275 newest_sw1_update_game = self .db .find_one (sort = [("_last_synced.switch_1" , - 1 )])
277276 newest_sw2_update_game = self .db .find_one (sort = [("_last_synced.switch_2" , - 1 )])
0 commit comments