mirror of
https://github.com/tucnak/telebot
synced 2024-11-11 01:10:39 +00:00
bot: accept Editable in Forward function
This commit is contained in:
parent
d4ff86a5dc
commit
c626aaabd5
9
bot.go
9
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).
|
// Forward behaves just like Send() but of all options it only supports Silent (see Bots API).
|
||||||
//
|
//
|
||||||
// This function will panic upon nil Message.
|
// This function will panic upon nil Editable.
|
||||||
func (b *Bot) Forward(to Recipient, what *Message, options ...interface{}) (*Message, error) {
|
func (b *Bot) Forward(to Recipient, msg Editable, options ...interface{}) (*Message, error) {
|
||||||
if to == nil {
|
if to == nil {
|
||||||
return nil, ErrBadRecipient
|
return nil, ErrBadRecipient
|
||||||
}
|
}
|
||||||
|
msgID, chatID := msg.MessageSig()
|
||||||
|
|
||||||
params := map[string]string{
|
params := map[string]string{
|
||||||
"chat_id": to.Recipient(),
|
"chat_id": to.Recipient(),
|
||||||
"from_chat_id": what.Chat.Recipient(),
|
"from_chat_id": strconv.FormatInt(chatID, 10),
|
||||||
"message_id": strconv.Itoa(what.ID),
|
"message_id": msgID,
|
||||||
}
|
}
|
||||||
|
|
||||||
sendOpts := extractOptions(options)
|
sendOpts := extractOptions(options)
|
||||||
|
Loading…
Reference in New Issue
Block a user