Making string of missing permissions and displaying them to the user

pull/8/head
sgoudham 4 years ago
parent cfad05e5f3
commit 76112ddf3b

@ -398,8 +398,8 @@ async def on_command_error(ctx, args2):
# Async def for handling command bad argument error # Async def for handling command bad argument error
async def on_bot_forbidden(ctx, args2): async def on_bot_forbidden(ctx, args2):
for perm in args2.missing_perms: # Convert list into string of the missing permissions
missing_perms = "".join(string.capwords(perm.replace("_", " "))) missing_perms = string.capwords(", ".join(args2.missing_perms).replace("_", " "))
# Send an error message to the user telling them that the member specified could not be found # Send an error message to the user telling them that the member specified could not be found
message = await ctx.send(f"I need **{missing_perms}** permission(s) to execute this command!") message = await ctx.send(f"I need **{missing_perms}** permission(s) to execute this command!")

Loading…
Cancel
Save