feat(plugins): expose thread_id to plugins (#99)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user