This commit is contained in:
shoopea 2019-10-12 13:29:15 +08:00
parent 444d911691
commit a87baa28d3

10
td.go
View File

@ -39,8 +39,8 @@ func ListenMQ(c *tdlib.Client, msgs <-chan TGCommand) {
func ListenTG(c *tdlib.Client) {
eventFilter := func(msg *tdlib.TdMessage) bool {
updateMsg := (*msg).(*tdlib.UpdateNewMessage)
chatID := updateMsg.Message.ChatID
userID := updateMsg.Message.SenderUserID
chatID := int64(updateMsg.Message.ChatID)
userID := int64(updateMsg.Message.SenderUserID)
forwardInfo := updateMsg.Message.ForwardInfo
for k, v := range cfg.Listen {
if (v.Chat == chatID || v.Chat == 0) &&
@ -95,11 +95,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) {
var chat int64
var m ChatWarsMessage
if *chatID64 == 0 {
chat = user_chtwrsbot
} else {
chat = *chatID64
}
chat = *chatID64
if *senderUserID64 != 0 {
userDetails, err := c.GetUser(int32(*senderUserID64))