Compare commits
No commits in common. "bb0862ba8b3fec6f48d7027478893bcb2244b90a" and "75454a3233b96b5aa2f081ce1435e5634829510f" have entirely different histories.
bb0862ba8b
...
75454a3233
|
@ -55,16 +55,14 @@ func (b *Kicker) NewBot(chatID int64) echotron.Bot {
|
|||
store := tongo.NewStore[db.Chat](Client)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
|
||||
chat, err := store.GetOne(ctx, tongo.E("chat_id", chatID))
|
||||
if err != nil {
|
||||
chat = &db.Chat{
|
||||
Item: tongo.NewID(),
|
||||
ChatId: chatID,
|
||||
Title: "",
|
||||
TopicId: 0,
|
||||
}
|
||||
if _, err := store.InsertOne(ctx, chat); err != nil {
|
||||
chat := db.Chat{
|
||||
Item: tongo.NewID(),
|
||||
ChatId: chatID,
|
||||
Title: "",
|
||||
TopicId: 0,
|
||||
}
|
||||
if _, err := store.GetOne(ctx, tongo.E("chat_id", chatID)); err != nil {
|
||||
if _, err := store.InsertOne(ctx, &chat); err != nil {
|
||||
return &bot{}
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +73,6 @@ func (b *Kicker) NewBot(chatID int64) echotron.Bot {
|
|||
nil,
|
||||
echotron.NewAPI(b.Token),
|
||||
}
|
||||
log.Println("New bot created with CaptchaTopic", result.CaptchaTopic)
|
||||
me, err := result.GetMe()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
|
Loading…
Reference in New Issue