1
0
Fork 0
mirror of synced 2024-06-03 11:14:33 +12:00

Handle no settings set for checking prefix config; show bad argument errors

This commit is contained in:
phxntxm 2019-03-02 13:14:42 -06:00
parent b0c4496f88
commit 82fa6e9984

View file

@ -109,10 +109,11 @@ class GuildConfiguration(commands.Cog):
async def _handle_show_prefix(self, ctx, setting): async def _handle_show_prefix(self, ctx, setting):
result = await ctx.bot.db.fetchrow("SELECT prefix FROM guilds WHERE id = $1", ctx.guild.id) result = await ctx.bot.db.fetchrow("SELECT prefix FROM guilds WHERE id = $1", ctx.guild.id)
if result is not None:
prefix = result["prefix"] prefix = result["prefix"]
if result and prefix is not None: if prefix is not None:
return f"Your current prefix is `{prefix}`" return f"Your current prefix is `{prefix}`"
else:
return "You do not have a custom prefix set, you are using the default prefix" return "You do not have a custom prefix set, you are using the default prefix"
async def _handle_show_followed_picarto_channels(self, ctx, opt): async def _handle_show_followed_picarto_channels(self, ctx, opt):
@ -746,8 +747,8 @@ Failed to parse the format string provided, possible keys are: {', '.join(k for
Extraneous args provided: {', '.join(k for k in exc.original.args)} Extraneous args provided: {', '.join(k for k in exc.original.args)}
""" """
await ctx.send(fmt) await ctx.send(fmt)
except commands.BadArgument: except commands.BadArgument as exc:
pass await ctx.send(exc)
else: else:
await ctx.invoke(ctx.bot.get_command("config"), opt=option) await ctx.invoke(ctx.bot.get_command("config"), opt=option)