Handle no settings set for checking prefix config; show bad argument errors
This commit is contained in:
parent
b0c4496f88
commit
82fa6e9984
|
@ -109,11 +109,12 @@ 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)
|
||||||
|
|
||||||
prefix = result["prefix"]
|
if result is not None:
|
||||||
if result and prefix is not None:
|
prefix = result["prefix"]
|
||||||
return f"Your current prefix is `{prefix}`"
|
if prefix is not None:
|
||||||
else:
|
return f"Your current prefix is `{prefix}`"
|
||||||
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):
|
||||||
result = await ctx.bot.db.fetchrow("SELECT followed_picarto_channels FROM guilds WHERE id = $1", ctx.guild.id)
|
result = await ctx.bot.db.fetchrow("SELECT followed_picarto_channels FROM guilds WHERE id = $1", ctx.guild.id)
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue