Skip to main content
This page describes the Message type from aion-authoring-adk. The Message object gives ADK authors a stable, provider-neutral view of the current inbound message without inspecting raw Slack, Telegram, or other provider payloads directly.

Import

from aion.adk.authoring.invocation import Message, User
Message is not constructed directly. Access it through thread.message:
from aion.adk.authoring.invocation import Thread, AionInvocationContext


async def _run_async_impl(self, ctx: AionInvocationContext):
    thread = Thread.from_context(ctx.aion_runtime_context)
    message = thread.message

    if message:
        await message.reply(f"You said: {message.text}")
thread.message is None when the inbound turn is a task rather than a message, so always guard before accessing it.

Properties

PropertyTypePurpose
idstr | NoneStable message identifier for the inbound turn
textstr | NonePlain-text body concatenated from message parts. Extension parts (Aion event envelope) are excluded automatically
userUser | NoneSender identity on the source network
threadThreadThe Thread this message belongs to

User Properties

PropertyTypePurpose
idstr | NoneUnique identifier of the user on the source network

Methods

MethodPurpose
reply(content, *, metadata=None)Convenience wrapper around thread.reply(...)
react(key, *, operation="add", display_value=None)Express a reaction against the current message

reply(...)

reply(...) is a convenience wrapper that delegates to thread.reply(...). It sends the reply to the same thread where the message arrived.
from aion.adk.authoring.invocation import Thread, AionInvocationContext


async def _run_async_impl(self, ctx: AionInvocationContext):
    thread = Thread.from_context(ctx.aion_runtime_context)
    message = thread.message

    if message:
        await message.reply("Got it!")
ParameterTypeDescription
contentstr | Card | Artifact | Event | async iteratorMessage content: plain text, Card, A2A Artifact, ADK Event, or stream of str chunks
metadatadict | NoneOptional metadata to attach to the reply

react(...)

react(...) expresses a normalized reaction against the current message.
ParameterTypeDescription
keystrReaction identifier (e.g., thumbsup, heart, thinking_face)
operation"add" | "remove"Whether to add or remove the reaction (default: "add")
display_valuestr | NoneHuman-readable reaction text; falls back to the reaction key when not provided
from aion.adk.authoring.invocation import Thread, AionInvocationContext


async def _run_async_impl(self, ctx: AionInvocationContext):
    thread = Thread.from_context(ctx.aion_runtime_context)
    message = thread.message

    if message:
        # Acknowledge receipt, do work, confirm completion
        await message.react("eyes")
        result = await run_analysis(message.text)
        await message.reply(result)
        await message.react("eyes", operation="remove")
        await message.react("white_check_mark")

Relation to Other Event Kinds

Not every inbound turn is a plain message. Reaction, command, and card-action turns may have specialized payloads. For those turns:
  • ctx.aion_runtime_context.event is the authoritative inbound event
  • thread.message may still be populated when the provider exposes a meaningful message anchor