- Moved all extension files to .example to not load them by default.

- Added and changed stuff in README
This commit is contained in:
Uwe Pfeifer 2025-05-07 08:13:46 +02:00
parent 1397d84545
commit d33f8ebc1a
3 changed files with 0 additions and 0 deletions

24
ext/test.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))