feat(plugins): expose thread_id to plugins (#99)

This commit is contained in:
banteg
2026-01-12 18:22:56 +04:00
committed by GitHub
parent 9d5fccab92
commit f638b8c32e
7 changed files with 65 additions and 20 deletions
+10
View File
@@ -183,6 +183,15 @@ Command handlers receive a `CommandContext` with:
Use `ctx.executor.run_one(...)` or `ctx.executor.run_many(...)` to reuse Takopi's
engine pipeline. Use `mode="capture"` to collect results and build a custom reply.
`ctx.message` and `ctx.reply_to` are `MessageRef` objects with:
- `channel_id` (`int | str`, chat/channel id)
- `message_id` (`int | str`, message id)
- `thread_id` (`int | str | None`; set when the transport supports threads, like Telegram topics)
- `raw` (transport-specific payload, may be `None`)
Example: key per-thread state by `(ctx.message.channel_id, ctx.message.thread_id)`.
---
## TransportRuntime helpers
@@ -228,6 +237,7 @@ async def on_message(...):
message_id=...,
text=...,
reply_to=...,
thread_id=...,
)
await handle_message(
exec_cfg,