Spaces:
Running
Running
Test
Browse files- __pycache__/horde.cpython-311.pyc +0 -0
- discord_bot.py +9 -10
__pycache__/horde.cpython-311.pyc
ADDED
Binary file (4.51 kB). View file
|
|
discord_bot.py
CHANGED
@@ -148,16 +148,6 @@ for command in json_data["command"]:
|
|
148 |
bot.tree.add_command(tree_command)
|
149 |
"""
|
150 |
|
151 |
-
async def dynamic_command(self, interaction: discord.Interaction, **kwargs):
|
152 |
-
print(kwargs)
|
153 |
-
await interaction.followup.send("This is a test message, it send from dynamic_command.")
|
154 |
-
|
155 |
-
tree_command = app_commands.Command(
|
156 |
-
name="test",
|
157 |
-
description="test",
|
158 |
-
callback=dynamic_command
|
159 |
-
)
|
160 |
-
bot.tree.add_command(tree_command)
|
161 |
|
162 |
"""
|
163 |
class MyClient(discord.Client):
|
@@ -185,6 +175,15 @@ MyClient(bot)
|
|
185 |
"""
|
186 |
|
187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
|
189 |
@bot.command()
|
190 |
async def ping(ctx):
|
|
|
148 |
bot.tree.add_command(tree_command)
|
149 |
"""
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
|
152 |
"""
|
153 |
class MyClient(discord.Client):
|
|
|
175 |
"""
|
176 |
|
177 |
|
178 |
+
async def test(interaction: discord.Interaction, x: str, y: int):
|
179 |
+
print(self)
|
180 |
+
print(interaction)
|
181 |
+
print(x)
|
182 |
+
print(y)
|
183 |
+
await interaction.response.send_message(f"x: {x}, y: {y}")
|
184 |
+
tree.add_command(app_commands.Command(name="test", description="test", callback=test, extras={}))
|
185 |
+
|
186 |
+
|
187 |
|
188 |
@bot.command()
|
189 |
async def ping(ctx):
|