pocc / bga_discord

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

Interactive setup is impossible #38

Open mavit opened 3 years ago

mavit commented 3 years ago

It's currently impossible to get past the following menu to set a username:

Choose a option number User: [unset] Password: [unset] Options 1 Set Board Game Arena username 2 Set Board Game Arena password 3 Set Board Game Arena default preferences 4 Set Board Game Arena game preferences 5 Set Terraforming Mars default preferences Type cancel to quit

Function send_main_setup_menu displays this menu and then does the following:

    contexts[str(message.author)]["context"] = "setup"

However, on receiving the next message, trigger_interactive_response does the following, setting context to the empty string and causing us to lose our place in the menus:

if curr_ctx in ["setup", "play", "status", "friend"] or author not in contexts or "timeout" not in contexts[author]:
        contexts[author] = {
            "subcommand": curr_ctx,
            "context": "",
            "timestamp": time.time(),
            "channel": message.channel,
            "menu": "",
        }
pocc commented 3 years ago

This is a good point. It might make sense to save new settings via a webform generated by the bot and just scrap interactive setup altogether.