Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions redbot/core/commands/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ async def send_pages(
and help_settings.use_menus is HelpMenuSetting.reactions
):
use_DMs = help_settings.max_pages_in_guild == 0
destination = ctx.author if use_DMs else ctx.channel
destination = ctx.author if use_DMs and ctx.interaction is None else ctx
# Specifically ensuring the menu's message is sent prior to returning
m = await (destination.send(embed=pages[0]) if embed else destination.send(pages[0]))
c = menus.DEFAULT_CONTROLS if len(pages) > 1 else {"\N{CROSS MARK}": menus.close_menu}
Expand All @@ -892,12 +892,13 @@ async def send_pages(
delete_delay = help_settings.delete_delay

messages: List[discord.Message] = []
page_destination = ctx if ctx.interaction and not use_DMs else destination
for page in pages:
try:
if embed:
msg = await destination.send(embed=page)
msg = await page_destination.send(embed=page)
else:
msg = await destination.send(page)
msg = await page_destination.send(page)
except discord.Forbidden:
return await ctx.send(
_(
Expand All @@ -907,8 +908,12 @@ async def send_pages(
)
else:
messages.append(msg)
if use_DMs and help_settings.use_tick:
await ctx.tick()
page_destination = destination
if use_DMs:
if ctx.interaction:
await ctx.send(_("I have sent the help message to your DMs."), ephemeral=True)
elif help_settings.use_tick:
await ctx.tick()
# The if statement takes into account that 'destination' will be
# the context channel in non-DM context.
if (
Expand Down
Loading