aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2022-06-22 14:48:29 +0100
committerGravatar GitHub <[email protected]>2022-06-22 14:48:29 +0100
commit38fe96282c57dcd85aa004ea341b6ba120db1d1a (patch)
tree40b1f41954a3ce528572c65776faabd4045430e7
parentMerge pull request #2199 from Numerlor/doc-description-headerlink (diff)
parentMerge branch 'main' into fix_return_button (diff)
Merge pull request #2197 from python-discord/fix_return_button
-rw-r--r--bot/exts/info/help.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/bot/exts/info/help.py b/bot/exts/info/help.py
index 34480db57..282f8c97a 100644
--- a/bot/exts/info/help.py
+++ b/bot/exts/info/help.py
@@ -57,16 +57,13 @@ class SubcommandButton(ui.Button):
async def callback(self, interaction: Interaction) -> None:
"""Edits the help embed to that of the subcommand."""
- message = interaction.message
- if not message:
- return
-
subcommand = self.command
if isinstance(subcommand, Group):
embed, subcommand_view = await self.help_command.format_group_help(subcommand)
else:
embed, subcommand_view = await self.help_command.command_formatting(subcommand)
- await message.edit(embed=embed, view=subcommand_view)
+
+ await interaction.response.edit_message(embed=embed, view=subcommand_view)
class GroupButton(ui.Button):
@@ -98,12 +95,8 @@ class GroupButton(ui.Button):
async def callback(self, interaction: Interaction) -> None:
"""Edits the help embed to that of the parent."""
- message = interaction.message
- if not message:
- return
-
embed, group_view = await self.help_command.format_group_help(self.command.parent)
- await message.edit(embed=embed, view=group_view)
+ await interaction.response.edit_message(embed=embed, view=group_view)
class CommandView(ui.View):
@@ -118,7 +111,7 @@ class CommandView(ui.View):
super().__init__()
if command.parent:
- self.children.append(GroupButton(help_command, command, emoji="↩️"))
+ self.add_item(GroupButton(help_command, command, emoji="↩️"))
async def interaction_check(self, interaction: Interaction) -> bool:
"""