Skip to content

Commit

Permalink
fix minor issue
Browse files Browse the repository at this point in the history
- when the channel was empty, could not retrieve and create a proper context

Co-Authored-By: Aluerie ❤#6524 <[email protected]>
  • Loading branch information
PaulMarisOUMary and Aluerie committed Jun 28, 2023
1 parent 2cb6c55 commit 8c7fca5
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions cogs/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,9 @@ def help_custom(self) -> tuple[str, str, str]:
@bot_has_permissions(send_messages=True)
@app_commands.command(name="help", description="Help command.")
@app_commands.checks.cooldown(1, 15.0, key=lambda i: (i.guild_id, i.user.id))
async def help(self, interaction: discord.Interaction):
async for hijacked_message in interaction.channel.history(limit=1):
pass
hijacked_message.author = interaction.user
await commands.Context(
message = hijacked_message,
bot = self.bot,
view = None,
prefix = f"{self.bot.user.mention} ",
command_failed = False,
interaction = interaction,
).send_help()
async def help(self, interaction: discord.Interaction[DiscordBot]):
context = await commands.Context.from_interaction(interaction)
await context.send_help()



Expand Down

0 comments on commit 8c7fca5

Please sign in to comment.