From d425b61755e02ae77e196fd78e299ba4c6a67ff0 Mon Sep 17 00:00:00 2001 From: Uwe Pfeifer Date: Wed, 7 May 2025 09:28:33 +0200 Subject: [PATCH] move test2.py.example to ext dir. --- ext/test2.py.example | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ext/test2.py.example diff --git a/ext/test2.py.example b/ext/test2.py.example new file mode 100644 index 0000000..03bdbb8 --- /dev/null +++ b/ext/test2.py.example @@ -0,0 +1,21 @@ +# pybot-f 2nd test extension ... other type of commands (this time, nogroup commands) +# this code has been copied from the docs/github +# +# + +import discord +from discord import app_commands +from discord.ext import commands + +class Test2Cog(commands.Cog): + def __init__(self, bot: commands.Bot) -> None: + self.bot = bot + + @app_commands.command(name="testcmd-1") + async def my_command(self, interaction: discord.Interaction) -> None: + """ /command-1 """ + await interaction.response.send_message("Hello from command 1!", ephemeral=True) + + +async def setup(bot: commands.Bot) -> None: + await bot.add_cog(Test2Cog(bot)) \ No newline at end of file