Skip to content

messages

Classes

MessageModel

Bases: BaseModel

Represents a message in a channel.

Attributes

id
id: str

Unique identifier for the message.

user_id
user_id: str

ID of the user who sent the message.

channel_id
channel_id: Optional[str] = None

ID of the channel the message belongs to.

reply_to_id
reply_to_id: Optional[str] = None

ID of the message this message is replying to.

parent_id
parent_id: Optional[str] = None

ID of the parent message if this is a thread reply.

is_pinned
is_pinned: bool = False

Whether the message is pinned.

pinned_by
pinned_by: Optional[str] = None

ID of the user who pinned the message.

pinned_at
pinned_at: Optional[int] = None

Timestamp when the message was pinned (epoch time in nanoseconds).

content
content: str

Content of the message.

data
data: Optional[dict] = None

Additional data associated with the message.

Dict Fields
  • files (list, optional): List of file objects associated with the message, each containing file metadata like URLs and types
meta
meta: Optional[dict] = None

Metadata associated with the message.

Dict Fields
  • model_id (str, optional): ID of the model that generated the message
  • model_name (str, optional): Name of the model that generated the message
  • done (bool, optional): Flag indicating if model processing is complete
created_at
created_at: int

Timestamp when the message was created (epoch time in nanoseconds).

updated_at
updated_at: int

Timestamp when the message was last updated (epoch time in nanoseconds).

MessageForm

Bases: BaseModel

Form for creating or updating a message.

Attributes

temp_id
temp_id: Optional[str] = None

Temporary ID for the message (used for optimistic UI updates).

content
content: str

Content of the message.

reply_to_id
reply_to_id: Optional[str] = None

ID of the message this message is replying to.

parent_id
parent_id: Optional[str] = None

ID of the parent message if this is a thread reply.

data
data: Optional[dict] = None

Additional data associated with the message.

Dict Fields
  • files (list, optional): List of file objects associated with the message, each containing file metadata like URLs and types
  • content (str, optional): Additional message content data used in message and replace events
  • embeds (list, optional): List of embedded content objects in the message
  • status (dict, optional): Status information about the message processing state
meta
meta: Optional[dict] = None

Metadata associated with the message.

Dict Fields
  • model_id (str, optional): ID of the model that generated the message
  • model_name (str, optional): Name of the model that generated the message
  • done (bool, optional): Flag indicating if model processing is complete

ReactionForm

Bases: BaseModel

Form for adding or removing a reaction.

Attributes

name
name: str

Name of the reaction (e.g., emoji or shortcode).

Reactions

Bases: BaseModel

Represents reactions to a message.

Attributes

name
name: str

Name of the reaction.

users
users: List[dict]

List of users who reacted with this reaction.

Dict Fields
  • id (str, required): User ID of the user who reacted
  • name (str, required): Name of the user who reacted
count
count: int

Total count of this reaction.

MessageUserResponse

Bases: MessageModel

Message model with user details included.

Attributes

user
user: Optional[UserNameResponse] = None

User who sent the message.

MessageReplyToResponse

Bases: MessageUserResponse

Message model with user details and reply-to message details.

Attributes

reply_to_message
reply_to_message: Optional[MessageUserResponse] = None

The message this message is replying to.

MessageWithReactionsResponse

Bases: MessageUserResponse

Message model with user details and reactions.

Attributes

reactions
reactions: List[Reactions]

List of reactions to the message.

MessageResponse

Bases: MessageReplyToResponse

Detailed message response including replies and reactions.

Attributes

latest_reply_at
latest_reply_at: Optional[int] = None

Timestamp of the latest reply (epoch time).

reply_count
reply_count: int = 0

Number of replies to this message.

reactions
reactions: List[Reactions]

List of reactions to the message.