Spaces:
Running
Running
Add annotation for dynamic_command
Browse files- discord_bot.py +1 -0
discord_bot.py
CHANGED
@@ -121,6 +121,7 @@ async def generateStatus(id: str):
|
|
121 |
|
122 |
# 根据 json 数据动态创建命令
|
123 |
for command in json_data["command"]:
|
|
|
124 |
async def dynamic_command(interaction: discord.Interaction, **kwargs):
|
125 |
print(kwargs)
|
126 |
await interaction.response.defer()
|
|
|
121 |
|
122 |
# 根据 json 数据动态创建命令
|
123 |
for command in json_data["command"]:
|
124 |
+
@tree.command(name=command["name"], description=command["description"])
|
125 |
async def dynamic_command(interaction: discord.Interaction, **kwargs):
|
126 |
print(kwargs)
|
127 |
await interaction.response.defer()
|