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