Add Discord model slash command

This commit is contained in:
hamb1y
2026-05-28 15:48:50 +08:00
committed by Xubin Ren
parent ac8bef76f6
commit 7d09f1cd9e
2 changed files with 36 additions and 1 deletions
+10
View File
@@ -207,6 +207,16 @@ if DISCORD_AVAILABLE:
) -> None:
await self._forward_slash_command(interaction, _command_text)
@self.tree.command(name="model", description="Show or switch runtime model preset")
@app_commands.describe(preset="Optional model preset name, such as default")
async def model_command(
interaction: discord.Interaction,
preset: str | None = None,
) -> None:
preset = (preset or "").strip()
command_text = f"/model {preset}" if preset else "/model"
await self._forward_slash_command(interaction, command_text)
@self.tree.command(name="help", description="Show available commands")
async def help_command(interaction: discord.Interaction) -> None:
sender_id = str(interaction.user.id)