updateScheduledUserMessage method

Future<ScheduledUserMessage> updateScheduledUserMessage({
  1. required ScheduledUserMessageUpdateParams params,
  2. required int scheduledMessageid,
  3. OnScheduledMessageCallback<ScheduledUserMessage>? callback,
})

Update scheduled user message

Implementation

Future<ScheduledUserMessage> updateScheduledUserMessage({
  required ScheduledUserMessageUpdateParams params,
  required int scheduledMessageid,
  OnScheduledMessageCallback<ScheduledUserMessage>? callback,
}) async {
  try {
    final result = await _sdk.api.send(
      GroupChannelScheduledUserMessageUpdateRequest(
        scheduledMessageId: scheduledMessageid,
        channelUrl: channelUrl,
        params: params,
      ),
    );
    if (callback != null) {
      callback(result, null);
    }
    return result;
  } catch (e) {
    if (callback != null) {
      final error = SBError(message: 'Failed Sending Request');
      callback(null, error);
    }
    rethrow;
  }
}