Chat / JavaScript
Chat JavaScript v4
Chat JavaScript
Chat
JavaScript
Home
/
Chat
/
JavaScript
/
Message
This is the new Docs for Chat SDK v4 for JavaScript. To see the previous Docs, click here.

Update a scheduled message

You can update a scheduled user message by passing ScheduledUserMessageUpdateParams as an argument to the updateScheduledUserMessage() method.

const params: ScheduledUserMessageUpdateParams = {
  message: 'Late shift, sad...',
  scheduledAt: TODAY_AT_SEVEN_PM,
};
// Updates a scheduled user message.
const updatedScheduledMessage: UserMessage = await channel.updateScheduledUserMessage(
  scheduledMessage.scheduledInfo.scheduledMessageId,
  params,
);

ScheduledUserMessageUpdateParams

interface ScheduledUserMessageUpdateParams extends UserMessageUpdateParams {
  scheduledAt?: number; // null
}

You can create a scheduled file message to send at a later time by passing ScheduledFileMessageCreateParams as an argument to the createScheduledFileMessage() method.

const params: ScheduledFileMessageUpdateParams = {
  scheduledAt: TODAY_AT_SEVEN_PM,
};
// Updates a scheduled file message.
const updatedScheduledMessage: FileMessage = await channel.updateScheduledFileMessage(
  scheduledMessage.scheduledInfo.scheduledMessageId,
  params,
);

ScheduledFileMessageUpdateParams

interface ScheduledFileMessageUpdateParams extends BaseMessageUpdateParams {
  scheduledAt?: number;
  file?: FileCompat;
  fileUrl?: string;
  fileName?: string;
  fileSize?: number;
  mimeType?: string;
  thumbnailSizes?: ThumbnailSize[];
  requireAuth?: boolean;
}