forwardMessage method
Use this method to forward messages of any kind. On success, the sent Message
is returned.
Implementation
Future<Message> forwardMessage(
dynamic chat_id, int from_chat_id, int message_id,
{bool? disable_notification}) async {
if (chat_id is! String && chat_id is! int) {
return Future.error(TelegramException(
'Attribute \'chat_id\' can only be either type of String or int'));
}
var requestUrl = _apiUri('forwardMessage');
var body = <String, dynamic>{
'chat_id': chat_id,
'from_chat_id': from_chat_id,
'message_id': message_id,
'disable_notification': disable_notification,
};
return Message.fromJson(await HttpClient.httpPost(requestUrl, body: body));
}