diff --git a/ext/test.py b/ext/test.py index 58ef5c9..279019b 100644 --- a/ext/test.py +++ b/ext/test.py @@ -1,20 +1,21 @@ # 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="testcogparent"): +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="sub1") + @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="sub2") + @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) diff --git a/ext/test2.py b/ext/test2.py index 2324a0b..03bdbb8 100644 --- a/ext/test2.py +++ b/ext/test2.py @@ -1,5 +1,7 @@ # 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 @@ -9,7 +11,7 @@ class Test2Cog(commands.Cog): def __init__(self, bot: commands.Bot) -> None: self.bot = bot - @app_commands.command(name="command-1") + @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) diff --git a/pybot-f.py b/pybot-f.py index 06fce2e..22436ec 100644 --- a/pybot-f.py +++ b/pybot-f.py @@ -18,12 +18,13 @@ config = configparser.ConfigParser() config.read('bot.ini') bottoken = config['General']['bottoken'] + bot = commands.Bot(command_prefix='.', description=description, intents=intents) @bot.event async def on_ready(): - print(f'Logged in as {bot.user} (ID: {bot.user.id})') + print(f'pybot-f logged in as {bot.user} (ID: {bot.user.id})') print('------')