pocc / bga_discord

Discord bot to create games on Board Game Arena
Apache License 2.0
11 stars 5 forks source link

Silent failure if user neglected to set a BGA password #32

Open mavit opened 3 years ago

mavit commented 3 years ago

With the new interactive setup flow, it's possible for a user to set a username but forget to set a password. If that happens, the bot will silently fail to make tables for them. The following appears on stderr:

Ignoring exception in on_message
Traceback (most recent call last):
  File "/home/mavit/src/bga_discord/venv/lib64/python3.8/site-packages/discord/client.py", line 333, in _run_event
    await coro(*args, **kwargs)
  File "./src/main.py", line 77, in on_message
    await trigger_interactive_response(message, contexts, message.content.split(" ")[0][1:], [])
  File "/home/mavit/src/bga_discord/src/menu_root.py", line 88, in trigger_interactive_response
    await cmd(message, contexts, args)
  File "/home/mavit/src/bga_discord/src/cmd_sub_play.py", line 56, in ctx_play
    await ctx_finish_and_create_game(message, contexts, args)
  File "/home/mavit/src/bga_discord/src/cmd_sub_play.py", line 128, in ctx_finish_and_create_game
    await setup_bga_game(message, str(message.author.id), game, players, options)
  File "/home/mavit/src/bga_discord/src/bga_create_game.py", line 16, in setup_bga_game
    account, errs = await get_active_session(p1_discord_id)
  File "/home/mavit/src/bga_discord/src/creds_iface.py", line 108, in get_active_session
    if login_info["password"] == "":
KeyError: 'password'