fix issue when listing roles in server with no personal roles assigned

This commit is contained in:
Brandon 2022-01-31 23:29:43 -05:00
parent 8a55a50017
commit 62b4054a33

View file

@ -126,6 +126,9 @@ class PersonalRoles(commands.Cog):
),
}
assigned_roles.append(dic)
if not assigned_roles:
await ctx.send(chat.info(_("There is no assigned personal roles on this server")))
return
pages = list(chat.pagify(tabulate(assigned_roles, headers="keys", tablefmt="orgtbl")))
pages = [chat.box(page) for page in pages]
await menu(ctx, pages, DEFAULT_CONTROLS)