Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SendMessageParams<T>

Base parameters for sending a message through a channel.

see

SendTextMessageParams — prefer for built-in text messages

example
// Prefer SendTextMessageParams for built-in text messages.
const params = new SendMessageParams<TextMessageContent>(
{ text: 'Hello, World!' },
MessageType.TEXT,
);
params.pushConfig = { pushTitle: 'New Message' };
const result = await channel.sendMessage(params);

Type Parameters

  • T extends Record<string, any>

    The type of the message content

Hierarchy

Index

Accessors

  • get content(): T
  • The message content payload

    Returns T

  • get messageType(): string
  • The registered message type identifier (e.g. 'RC:TxtMsg')

    Returns string

Properties

directedUserIds?: string[]

List of target user IDs for directed messages. Only these users will receive the message.

disableNotification?: boolean

If true, suppress push notifications for this message

disableUpdateLastMessage?: boolean

If true, this message will not update the channel's last message

needReceipt?: boolean

If true, request read receipt for this message

metadata?: Record<string, string>

Key-value metadata (expansion) to attach to the message

pushConfig?: PushConfig

Push notification configuration for this message

onSendBefore?: ((message: Message<T>) => void)

Type declaration

    • Callback invoked before the message is sent, providing the local message instance

      Parameters

      Returns void

Constructors

  • Creates a new SendMessageParams instance.

    Type Parameters

    • T extends Record<string, any>

    Parameters

    • content: T

      The message content payload

    • messageType: string

      The registered message type identifier

    Returns SendMessageParams<T>