updateScheduledMessage

fun updateScheduledMessage(id: String, message: Message, scheduledAt: Date? = null): Call<ScheduledMessage>

Edits the content of a scheduled message, and reschedules it when scheduledAt is set. The change is saved locally first, and sent to the server like a new scheduled message (see scheduleMessage). An edit made before the message reached the server goes out with it.

The edit is refused before it is saved when the message starts with / in a channel that has commands, when it quotes a message that was deleted, or when scheduledAt is further ahead than Config.scheduledMessagesMaxLeadTimeSeconds, as known from the channel config and messages saved on this device. A message the server failed to send (ScheduledMessageFailure.ServerFailedPublishing) can't be edited: the server rejects the edit, so delete it and schedule a new message instead.

Return

Executable async Call responsible for editing the scheduled message, with the scheduled message as saved locally.

Parameters

id

The ID of the scheduled message.

message

The new content, which replaces the whole content of the scheduled message. The ScheduledMessage.message can be passed back with its changes. For a message a backend scheduled, remove the mml of its Message.extraData first, as a client can't send it without the permission.

scheduledAt

The new date when the message is sent, or null to keep it. The server rounds it up to the next minute.