// Create a scheduled user message.
final params = ScheduledUserMessageCreateParams(
scheduledAt: DateTime.now().millisecondsSinceEpoch + 600000, // 10 minutes
message: 'SCHEDULED_MESSAGE',
translationTargetLanguages: ['ko', 'en'],
);
try {
// The returned message is a pending message instance for the scheduled message.
// It can be used in the same way as pending message from sendUserMessage().
final pendingScheduledUserMessage = await groupChannel.createScheduledUserMessage(params);
} catch (e) {
// Handle error.
}
// Create a scheduled file message.
final params = ScheduledFileMessageCreateParams.withFile(
FILE,
scheduledAt: DateTime.now().millisecondsSinceEpoch + 600000, // 10 minutes
);
try {
// The returned message is a pending message instance for the scheduled message.
// It can be used in the same way as pending message from sendFileMessage().
final pendingScheduledFileMessage = await channel.createScheduledFileMessage(params);
} catch (e) {
// Handle error.
}