From c7645ba99c1db912747f470d99d7c1193f8f2640 Mon Sep 17 00:00:00 2001 From: shoopea Date: Tue, 27 Aug 2019 11:32:41 +0800 Subject: [PATCH] test forward --- td.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/td.go b/td.go index af5486d..0dbb436 100644 --- a/td.go +++ b/td.go @@ -196,14 +196,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { } func ForwardMsg(c *tdlib.Client, msgID int64, fromChatID int64, toChatID int64) int64 { - msgIDs := make([]int64, 1) - msgIDs[0] = msgID - msgs, _ := c.ForwardMessages(toChatID, fromChatID, msgIDs, false, false, false) - if msgs != nil { - return msgs.Messages[0].ID - } else { - return 0 - } + } func DeleteMsg(c *tdlib.Client, chatID int64, msgID int64) { @@ -236,6 +229,11 @@ func clientMsg(c *tdlib.Client, m TGCommand) { } switch m.Type { + case commandForwardMsg: + msgIDs := make([]int64, 1) + msgIDs[0] = msgID + c.ForwardMessages(m.ToChatID64, m.FromChatID64, msgIDs, false, false, false) + case commandSendMsg: msgTxt := tdlib.NewInputMessageText(tdlib.NewFormattedText(m.Text, nil), true, true) if m.ToChatID64 != 0 {