test getchat
This commit is contained in:
parent
83ccdf35df
commit
00db9c6fc5
10
main.go
10
main.go
@ -138,11 +138,9 @@ func PillageKnight(c *tdlib.Client) {
|
||||
receiver := c.AddEventReceiver(&tdlib.UpdateNewMessage{}, eventFilter, 100)
|
||||
for newMsg := range receiver.Chan {
|
||||
updateMsg := (newMsg).(*tdlib.UpdateNewMessage)
|
||||
// senderUserID := updateMsg.Message.SenderUserID
|
||||
mType := updateMsg.Message.Content.GetMessageContentEnum()
|
||||
if mType == "messageText" {
|
||||
/*
|
||||
user, err := c.GetUser(senderUserID)
|
||||
if err != nil {
|
||||
fmt.Println("Pillage:", err.Error())
|
||||
continue
|
||||
@ -732,9 +730,15 @@ func ForwardMsg(c *tdlib.Client, msgID int64, fromChatID int64, toChatID int64)
|
||||
fmt.Printf("ForwardMsg fromChatID : %d\n", fromChatID)
|
||||
fmt.Printf("ForwardMsg toChatID : %d\n", toChatID)
|
||||
fmt.Printf("ForwardMsg msgID : %d\n", msgID)
|
||||
chat, err := c.GetChat(toChatID)
|
||||
if err != nil {
|
||||
fmt.Printf("ForwardMsg.GetChat : error : %s\n", err.Error())
|
||||
}
|
||||
fmt.Printf("ForwardMsg ChatID : %d\n", chat.ID)
|
||||
|
||||
msgs, err := c.ForwardMessages(toChatID, fromChatID, msgIDs, false, false, false)
|
||||
if err != nil {
|
||||
fmt.Printf("ForwardMsg (error) : %s\n", err.Error())
|
||||
fmt.Printf("ForwardMsg.ForwardMessages : error : %s\n", err.Error())
|
||||
}
|
||||
if msgs != nil {
|
||||
return msgs.Messages[0].ID
|
||||
|
Loading…
Reference in New Issue
Block a user