upd
This commit is contained in:
parent
da51179222
commit
05f49beb73
3
main.go
3
main.go
@ -113,10 +113,7 @@ func main() {
|
||||
ownUserID32 = OwnUserID(client)
|
||||
ownUserID64 = int64(OwnUserID(client))
|
||||
|
||||
log.Println("Plop ..")
|
||||
|
||||
if *history {
|
||||
log.Println("Getting history ..")
|
||||
getHistory(client)
|
||||
}
|
||||
|
||||
|
6
td.go
6
td.go
@ -141,7 +141,8 @@ func getHistory(c *tdlib.Client) {
|
||||
lastMsgID64 = -1
|
||||
} else {
|
||||
for _, msg := range msgs.Messages {
|
||||
|
||||
switch msg.Content {
|
||||
case tdlib.MessageTextType:
|
||||
m := ChatWarsMessage{
|
||||
UserID64: int64(msg.SenderUserID),
|
||||
MsgDate: msg.Date,
|
||||
@ -168,6 +169,9 @@ func getHistory(c *tdlib.Client) {
|
||||
if msg.ID < lastMsgID64 {
|
||||
lastMsgID64 = msg.ID
|
||||
}
|
||||
default:
|
||||
log.Printf("getHistory : no handler for %s\n", msg.Content)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user