diff --git a/td.go b/td.go index dedc19a..e57aac7 100644 --- a/td.go +++ b/td.go @@ -195,13 +195,6 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { fmt.Printf("Exported %d messages.\n", msgCount) } -func DeleteMsg(c *tdlib.Client, chatID int64, msgID int64) { - msgIDs := make([]int64, 1) - msgIDs[0] = msgID - c.DeleteMessages(chatID, msgIDs, false) - fmt.Println("Deleting message ", msgID) -} - func OwnUserID(c *tdlib.Client) int32 { user, _ := c.GetMe() return user.ID @@ -237,6 +230,12 @@ func clientMsg(c *tdlib.Client, m TGCommand) { } else if m.ToUserID64 != 0 { c.SendMessage(m.ToUserID64, 0, false, false, nil, msgTxt) } + + case commandDeleteMsg: + msgIDs := make([]int64, 1) + msgIDs[0] = m.FromMsgID64 + c.DeleteMessages(m.FromChatID64, msgIDs, false) + case commandRefreshMsg: u, err := c.GetMessage(m.FromChatID64, m.FromMsgID64) logOnError(err, "ListenMQ : commandRefreshMsg")