/ SDKs / JavaScript
SDKs
Chat SDKs JavaScript v4
Chat SDKs JavaScript
Chat SDKs
JavaScript
Version 4

Update a scheduled message

Copy link

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

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

ScheduledUserMessageUpdateParams

Copy link
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.

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

ScheduledFileMessageUpdateParams

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