User runs /ticket <subject>; the bot creates a private thread and posts the details there. create_thread needs discord:manage_channels (auto-detected).
@plugin.on_slash_command("ticket")
def open_ticket(ctx: Context, event: dict):
opts = {o["name"]: o["value"] for o in event.get("options", [])}
subject = opts.get("subject") or "Support request"
thread = ctx.discord.create_thread(
channel_id=event["channel_id"],
name=f"ticket-{event['user_id']}"[:100],
thread_type=12, # 12 = private thread
)
ctx.discord.send_message(channel_id=thread["id"],
content=f"**Ticket from <@{event['user_id']}>**: {subject}")
ctx.interaction.respond(content="Ticket opened. Staff will reply shortly.")