reset bot token, testing ext functionality.
This commit is contained in:
parent
4aa5c1b940
commit
6f7e7ce7b0
2 changed files with 25 additions and 2 deletions
23
ext/test.py
Normal file
23
ext/test.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# pybot-f test extension ...
|
||||
|
||||
import discord
|
||||
from discord import app_commands
|
||||
from discord.ext import commands
|
||||
|
||||
class TestCog(commands.GroupCog, name="testcogparent"):
|
||||
def __init__(self, bot: commands.Bot) -> None:
|
||||
self.bot = bot
|
||||
super().__init__() # this is now required in this context.
|
||||
|
||||
@app_commands.command(name="sub1")
|
||||
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")
|
||||
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))
|
|
@ -37,5 +37,5 @@ async def joined(ctx, member: discord.Member):
|
|||
"""Says when a member joined."""
|
||||
await ctx.send(f'{member.name} joined {discord.utils.format_dt(member.joined_at)}')
|
||||
|
||||
|
||||
bot.run('OTc5MzU2MjY4NzkzODMxNDI1.GTX-gW.l7Oc7YoVfAQIUBarQ3jXB6upNKYdD0jeCuAGXE')
|
||||
bot.load_extension("ext/test.py")
|
||||
bot.run(bottoken)
|
Loading…
Add table
Reference in a new issue