Skip to content

Commit

Permalink
chore: remove setgame command
Browse files Browse the repository at this point in the history
  • Loading branch information
GianmarcoBasile committed Nov 17, 2023
1 parent 579c771 commit f48aab6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
19 changes: 0 additions & 19 deletions src/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,6 @@ async def start(update, context):
redis_instance.set(update.message.from_user['username'], json.dumps({'games': {}}))
await update.message.reply_text('Benvenuto su Steam News Bot!')

async def setGame(update, context):
# TEST: redis_instance.set('gianmarco', json.dumps({'games': '1234'}))
try:
if context.args:
games = []
game_name = ' '.join(context.args).lower()
if game_name in app_list.values():
user_record = redis_instance.get(update.message.from_user['username'])
games_json = {'games': {0: game_name}}
games = list(games_json['games'].values())
redis_instance.set(update.message.from_user['username'], json.dumps(games_json))
await update.message.reply_text('Games set to ' + str(games).replace('[', '').replace(']', '').replace("'", ''))
else:
await update.message.reply_text('Game not found')
else:
await update.message.reply_text('La sintassi del comando prevede un argomento: /setgame <game_id>')
except Exception as e:
print(e)

async def addGame(update, context):
try:
if context.args:
Expand Down
1 change: 0 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def main():
"""Main function which runs the bot and adds the handlers"""
# Commands
bot_instance.application.add_handler(CommandHandler('start', start))
bot_instance.application.add_handler(CommandHandler('setgame', setGame))
# application.add_handler(CommandHandler('getnews', getNews))
bot_instance.application.add_handler(CommandHandler('addgame', addGame))
bot_instance.application.add_handler(CommandHandler('favoritegames', getFavoriteGames))
Expand Down

0 comments on commit f48aab6

Please sign in to comment.