fix (rroles): Repair setting error reply.

Modified `error_reply` utility so `kwargs` are passed to `Embed`.
Added `send_args` kwarg to `error_reply`.

Fixed an rroles issue where `UserInputError` handling would fail.
This commit is contained in:
2021-11-07 15:00:04 +02:00
parent 0e62ebdb2b
commit 4c21160b31
2 changed files with 7 additions and 6 deletions

View File

@@ -26,21 +26,22 @@ async def embed_reply(ctx, desc, colour=discord.Colour.orange(), **kwargs):
@Context.util
async def error_reply(ctx, error_str, **kwargs):
async def error_reply(ctx, error_str, send_args={}, **kwargs):
"""
Notify the user of a user level error.
Typically, this will occur in a red embed, posted in the command channel.
"""
embed = discord.Embed(
colour=discord.Colour.red(),
description=error_str
description=error_str,
**kwargs
)
message = None
try:
message = await ctx.ch.send(
embed=embed,
reference=ctx.msg.to_reference(fail_if_not_exists=False),
**kwargs
**send_args
)
ctx.sent_messages.append(message)
return message