add delete msg
This commit is contained in:
parent
edfd1cb34f
commit
7d15dfd476
13
td.go
13
td.go
@ -195,13 +195,6 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) {
|
|||||||
fmt.Printf("Exported %d messages.\n", msgCount)
|
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 {
|
func OwnUserID(c *tdlib.Client) int32 {
|
||||||
user, _ := c.GetMe()
|
user, _ := c.GetMe()
|
||||||
return user.ID
|
return user.ID
|
||||||
@ -237,6 +230,12 @@ func clientMsg(c *tdlib.Client, m TGCommand) {
|
|||||||
} else if m.ToUserID64 != 0 {
|
} else if m.ToUserID64 != 0 {
|
||||||
c.SendMessage(m.ToUserID64, 0, false, false, nil, msgTxt)
|
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:
|
case commandRefreshMsg:
|
||||||
u, err := c.GetMessage(m.FromChatID64, m.FromMsgID64)
|
u, err := c.GetMessage(m.FromChatID64, m.FromMsgID64)
|
||||||
logOnError(err, "ListenMQ : commandRefreshMsg")
|
logOnError(err, "ListenMQ : commandRefreshMsg")
|
||||||
|
Loading…
Reference in New Issue
Block a user