diff --git a/bot/cogs/misc.py b/bot/cogs/misc.py index 468404f..d788f4b 100644 --- a/bot/cogs/misc.py +++ b/bot/cogs/misc.py @@ -112,6 +112,7 @@ def construct_load_bar_string(percent: int, suffix_message: str = None, size: in @app_commands.choices(name=[ app_commands.Choice(name="Ask", value="ask"), app_commands.Choice(name="Markdown", value="markdown"), + app_commands.Choice(name="Spoiler", value="spoiler"), app_commands.Choice(name="Run Help", value="run_help"), app_commands.Choice(name="Zen", value="zen"), app_commands.Choice(name="Add to Issues", value="add_to_issues") @@ -152,6 +153,26 @@ async def tag(self, interaction: discord.Interaction, name: app_commands.Choice[ message = await interaction.original_response() await RemovableMessage.create_instance(self.bot, message, interaction.user) + elif value == "spoiler": + content = ( + "You can hide your code by applying spoiler tags like this:\n\n" + "\\|\\|\n\\`\\`\\`python\n" + "print('Hello world')\n" + "\\`\\`\\`\\|\\|\n\n" + "This would give you:\n" + "||```python\n" + "print('Hello world')```||\n" + "**Video explanation:**\n" + ) + embed = info( + content, interaction.guild.me, "", + "Note: The character | is the pipe operator." + ) + embed.set_image(url="https://lairesit.sirv.com/Tortoise/howtoapplyspoiler.gif") + await interaction.response.send_message(embed=embed) + message = await interaction.original_response() + await RemovableMessage.create_instance(self.bot, message, interaction.user) + elif value == "run_help": content = ( "# How to Run Code using the bot\n\n"