This commit is contained in:
shoopea 2019-05-04 17:57:45 +08:00
parent 9e157a1945
commit 816189a158
2 changed files with 5 additions and 5 deletions

View File

@ -32,8 +32,8 @@ type Config struct {
var (
config = flag.String("config", "gocw2.cfg", "config file path")
history = flag.Bool("history", false, "initialize chat history")
historyChatID64 = flag.int64("chat_id", nil, "chat to historize")
historySenderUserID64 = flag.int64("sender_user_id", nil, "sender_user_id to historize")
historyChatID64 = flag.Int64("chat_id", 0, "chat to historize")
historySenderUserID64 = flag.Int64("sender_user_id", 0, "sender_user_id to historize")
cfg Config

6
td.go
View File

@ -72,10 +72,10 @@ func getHistory(c *tdlib.Client, chatID64 int64, senderUserID64 int64) {
var msgCount int32 = 0
var lastMsgTime time.Time = time.Now()
if chatID64 == nil {
c := user_chtwrsbot
if chatID64 == 0 {
chat := user_chtwrsbot
} else {
c = chatID64
chat = chatID64
}
for lastMsgID64 >= 0 {