> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Platform Event • AI Agent SDK

> PlatformEvent: A normalised inbound platform event that is not a text/media message.

# PlatformEvent

> Defined in the [**protocols**](../modules/protocols) module.

<Badge color="blue">AI Agent</Badge>

A normalised inbound platform event that is not a text/media message.

Reactions, edits, deletions, membership changes and thread lifecycle are
delivered by the platform SDK but are not messages. This is the single
shared, protocol-only contract every adapter emits into and every hook or
plugin consumes — the inbound counterpart to the outbound `ReactionResult`
/ message-action surface the bot already ships.

Adapters build one of these from the native event and emit it via
`MessageHookMixin.fire_platform_event` (praisonai-bot), which routes it to
the matching :class:`~praisonaiagents.hooks.types.HookEvent`
(`REACTION_RECEIVED`/`MESSAGE_EDITED`/`MESSAGE_DELETED`/
`MEMBER_JOINED`/`MEMBER_LEFT`/`THREAD_CREATED`). Platforms that cannot
deliver a given event simply never build one — graceful, capability-gated,
exactly like the outbound `capabilities["reactions"]` gate.

Attributes:
kind: Which normalised event this is (see :data:`PlatformEventKind`).
platform: Emitting platform name (`"telegram"`/`"discord"`/…).
chat\_id: Channel/chat the event occurred in.
user\_id: The user who caused the event (reactor, editor, joiner, …).
message\_id: The message the event targets (reactions/edits/deletes).
emoji: The reaction emoji, for reaction add/remove.
new\_text: The new content, for an edit.
thread\_id: The thread identifier, for thread creation / threaded events.
raw: Escape hatch to the native SDK payload for adapter-specific needs.

## Properties

<ResponseField name="kind" type="PlatformEventKind">
  No description available.
</ResponseField>

<ResponseField name="platform" type="str">
  No description available.
</ResponseField>

<ResponseField name="chat_id" type="str">
  No description available.
</ResponseField>

<ResponseField name="user_id" type="str">
  No description available.
</ResponseField>

<ResponseField name="message_id" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="emoji" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="new_text" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="thread_id" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="raw" type="Optional">
  No description available.
</ResponseField>

<Accordion title="Internal & Generic Methods">
  * **to\_dict**: Convert to dictionary (native `raw` payload intentionally omitted).
</Accordion>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/bots/protocols.py#L711">
  `praisonaiagents/bots/protocols.py` at line 711
</Card>
