mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-08 12:18:54 -05:00
[Utils] Allow menu() to be used DM (#2183)
`ctx.me` handles using `ctx.guild.me` if `ctx.guild is not None` `ctx.guild.me` directly errors in DMs.
This commit is contained in:
parent
7b15ad5989
commit
fdf3f86ab0
@ -104,7 +104,7 @@ async def next_page(
|
||||
timeout: float,
|
||||
emoji: str,
|
||||
):
|
||||
perms = message.channel.permissions_for(ctx.guild.me)
|
||||
perms = message.channel.permissions_for(ctx.me)
|
||||
if perms.manage_messages: # Can manage messages, so remove react
|
||||
try:
|
||||
await message.remove_reaction(emoji, ctx.author)
|
||||
@ -126,17 +126,17 @@ async def prev_page(
|
||||
timeout: float,
|
||||
emoji: str,
|
||||
):
|
||||
perms = message.channel.permissions_for(ctx.guild.me)
|
||||
perms = message.channel.permissions_for(ctx.me)
|
||||
if perms.manage_messages: # Can manage messages, so remove react
|
||||
try:
|
||||
await message.remove_reaction(emoji, ctx.author)
|
||||
except discord.NotFound:
|
||||
pass
|
||||
if page == 0:
|
||||
next_page = len(pages) - 1 # Loop around to the last item
|
||||
page = len(pages) - 1 # Loop around to the last item
|
||||
else:
|
||||
next_page = page - 1
|
||||
return await menu(ctx, pages, controls, message=message, page=next_page, timeout=timeout)
|
||||
page = page - 1
|
||||
return await menu(ctx, pages, controls, message=message, page=page, timeout=timeout)
|
||||
|
||||
|
||||
async def close_menu(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user