Skip to content

Commit 93b070d

Browse files
7bitlyrusgithub-actions[bot]MattBSG
authored
Upgrade games and social cogs to use DekuDeals as a data source (#138)
* WIP: readd old giantbomb logic and start adapting for DekuDeals * auto: format python code * WIP: Update game syncing logic for DekuDeals * auto: format python code * WIP: Update game status command for deku deals * auto: format python code * games.py: Rewrite game search command for DekuDeals * auto: format python code * Fix minor bugs in games.py * Fix minor bugs in games.py * auto: format python code * games.py: Move data provided by to footer * games.py search: update footer, add sale amount * social.py: remove old profile legacy prefix commands * auto: format python code * games.py: Fix free game price * Update social.py to use new DekuDeals games cog/data * auto: format python code * social.py: Add migration for favgames * auto: format python code * social.py favgames migration: Fix logic error, improve logging * auto: format python code * Replace fuzzywuzzy with rapidfuzz, readd autocomplete * auto: format python code * games.py: Add top games to game search autocomplete, optimize search * games.py: nit comment update * nit: typehint * nit: add UA to games.get_image request * Replace dekudeals platform `switch_1` with correct `switch` * Remove unused imports --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matthew Cohen <matt@mattbsg.xyz>
1 parent c2818aa commit 93b070d

File tree

9 files changed

+392
-292
lines changed

9 files changed

+392
-292
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
bot/
33
.vscode/
44
*.json
5+
!giantbomb_names.json
56
config.py
67

78
# Byte-compiled / optimized / DLL files

config.example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# Sentry DSN
66
DSN = ''
77

8-
# Giantbomb Api Credentials
9-
giantbomb = 'key'
8+
# Api Credentials
9+
dekudeals = 'key'
1010

1111
# Mongo Credentials
1212
mongoURI = 'MongoDB URI'

giantbomb_names.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

modules/core.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,12 @@ async def _update_cache(self, interaction: discord.Interaction):
811811
f'<@{interaction.user.id}> Syncronization completed. Took {timeToComplete}'
812812
)
813813

814+
@update_group.command(name='gamedb', description='Fetch games database updates from DekuDeals')
815+
@app_commands.default_permissions(view_audit_log=True)
816+
async def _update_game_db(self, interaction: discord.Interaction):
817+
gamesCog = self.bot.get_cog('Games')
818+
await gamesCog.games_sync(interaction)
819+
814820
@app_commands.command(name='shutdown', description='Shutdown the bot and all modules')
815821
@app_commands.guilds(discord.Object(id=config.nintendoswitch))
816822
@app_commands.default_permissions(manage_guild=True)

0 commit comments

Comments
 (0)