move test example extensions to have proper

filenames
This commit is contained in:
Uwe Pfeifer 2025-05-16 19:47:10 +02:00
parent 4a5f85860e
commit a3d280d24f
2 changed files with 0 additions and 0 deletions

24
ext/grpcmds.py.example Normal file
View file

@ -0,0 +1,24 @@
# pybot-f test extension ...
# this code has been copied from the docs/github
import discord
from discord import app_commands
from discord.ext import commands
class TestCog(commands.GroupCog, name="testgrpcmds"):
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
super().__init__() # this is now required in this context.
@app_commands.command(name="sub-1")
async def my_sub_command_1(self, interaction: discord.Interaction) -> None:
""" /parent sub-1 """
await interaction.response.send_message("Hello from sub command 1", ephemeral=True)
@app_commands.command(name="sub-2")
async def my_sub_command_2(self, interaction: discord.Interaction) -> None:
""" /parent sub-2 """
await interaction.response.send_message("Hello from sub command 2", ephemeral=True)
async def setup(bot: commands.Bot) -> None:
await bot.add_cog(TestCog(bot))