Jorgen1040/jassa-bot

Make `+together` command display list of available names dynamically

Closed this issue · 0 comments

Using the new DiscordTogether.default_choices in 1.1.2 (see #52) to display the full list not hardcoded. See attached portion of code for what needs to be changed:

jassa-bot/src/bot.py

Lines 235 to 243 in 7542a56

@together.error
async def together_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.message.add_reaction(no)
await ctx.send(
"Please specify what application you want to use.\n"
"Available applications:\n"
"`youtube`, `poker`, `betrayal`, `fishing`, `chess`"
)

Try this instead:

app_list = ""
for app in DiscordTogether.default_choices:
    app_list += f"`{app}`, "
await ctx.send( 
             "Please specify what application you want to use.\n" 
             "Available applications:\n" 
             app_list 
         )