From c626aaabd57e248456d7703e4303baea4ee45508 Mon Sep 17 00:00:00 2001 From: Demian Date: Thu, 21 May 2020 12:13:20 +0300 Subject: [PATCH] bot: accept Editable in Forward function --- bot.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bot.go b/bot.go index 6d2faeb..3fc9d7c 100644 --- a/bot.go +++ b/bot.go @@ -633,16 +633,17 @@ func (b *Bot) Reply(to *Message, what interface{}, options ...interface{}) (*Mes // Forward behaves just like Send() but of all options it only supports Silent (see Bots API). // -// This function will panic upon nil Message. -func (b *Bot) Forward(to Recipient, what *Message, options ...interface{}) (*Message, error) { +// This function will panic upon nil Editable. +func (b *Bot) Forward(to Recipient, msg Editable, options ...interface{}) (*Message, error) { if to == nil { return nil, ErrBadRecipient } + msgID, chatID := msg.MessageSig() params := map[string]string{ "chat_id": to.Recipient(), - "from_chat_id": what.Chat.Recipient(), - "message_id": strconv.Itoa(what.ID), + "from_chat_id": strconv.FormatInt(chatID, 10), + "message_id": msgID, } sendOpts := extractOptions(options)