Language

EventContent Class

Definition

Represents the inner event object from a Slack Events API callback payload. Slack calls this the "event content"; the full payload is preserved as a JsonObject so any field from any event type can be accessed via Get<T>(String) using the same snake_case names shown in the Slack docs. See https://docs.slack.dev/reference/events

[System.Text.Json.Serialization.JsonConverter(typeof(Microsoft.Agents.Extensions.Slack.Api.EventContentConverter))]
public class EventContent : Microsoft.Agents.Extensions.Slack.Api.SlackModel
[<System.Text.Json.Serialization.JsonConverter(typeof(Microsoft.Agents.Extensions.Slack.Api.EventContentConverter))>]
type EventContent = class
    inherit SlackModel
Public Class EventContent
Inherits SlackModel
Inheritance
EventContent
Attributes

Properties

Name Description
AdditionalProperties

Catch-all for any envelope fields not explicitly modelled above.

channel

Channel ID where the event occurred.

channel_type

Channel type, e.g. "im", "channel", "group" (message events).

client_msg_id

Client-generated unique message ID (message events).

event_ts

Timestamp of when this event was fired.

item_user

User ID of the owner of the item that was reacted to (reaction events).

reaction

Reaction name without colons, e.g. "raised_hands" (reaction events).

subtype

Message subtype, if present (message events).

team

Team/workspace ID associated with the event.

text

The message body text (message events).

ts

Timestamp of the object this event describes (e.g. a message ts).

type

Event type, e.g. "message", "reaction_added", "reaction_removed".

user

User ID of the person who triggered this event (not present on all events).

Methods

Name Description
Get<T>(String)

Gets a value at the given dot-notation path. Supports dot-separated property access and bracket array indexing (e.g. "message.attachments[0].text"). Returns default when the path does not exist or the value cannot be converted to T.

(Inherited from SlackModel)
GetData()

Returns the JsonObject used for path navigation. The default implementation lazily serializes this instance via JsonSerializer.SerializeToNode, making every property and [JsonExtensionData] field addressable. Override when the subclass is already backed by a JsonObject to return it directly.

NormalizePath(String)

Normalizes a caller-supplied path before it is passed to the navigator. Override to remap C# property-name aliases to their JSON field names. The default implementation returns the path unchanged.

(Inherited from SlackModel)
TryGet<T>(String, T)

Tries to get a value at the given dot-notation path. Returns false when the path does not exist or the value cannot be converted to T.

(Inherited from SlackModel)

Applies to