Platform actions
ctx.platform_actions gives a plugin a minimal, capability-gated verb set for acting on connected chat platforms through the live gateway adapter registry - the sanctioned alternative to monkeypatching an adapter. It is off by default : every call re-checks the gateway.platform_actions capability (legacy key plugins.entries.<id>.allow_platform_actions ), and an ungranted call returns a structured error instead of acting. v1 verbs (both async , both return a plain dict, and neither ever raises into hook dispatch): Success is {"ok": True, "action": <verb>} . Failures are {"ok": False, "error": <code>, "detail": <str>} with stable error codes: capability_not_granted , invalid_argument , gateway_unavailable , unknown_platform , adapter_not_registered , adapter_disconnected , unsupported_platform_action , action_failed . Actions validate that the target adapter exists and is connected before acting; a disconnected or missing adapter degrades to a structured error, never an exception. Platforms supported in v1: Telegram and Discord. Telegram's add_reaction sets the bot's reaction (the Bot API replaces a previous bot reaction rather than stacking). Every action - allowed or denied - is wri…
From the official Hermes Agent documentation.
result = await ctx.platform_actions.add_reaction(
platform="telegram", chat_id="-100123", message_id="456", emoji="👍",
)
result = await ctx.platform_actions.set_thread_title(
platform="discord", chat_id="123", thread_id="456", title="New title",
)
if not result["ok"]:
print(result["error"], result.get("detail"))