Method
AddDefaultClient
(client *gotgproto.Client, self *tg.User)
Source from the content-addressed store, hash-verified
| 46 | } |
| 47 | |
| 48 | func (w *BotWorkers) AddDefaultClient(client *gotgproto.Client, self *tg.User) { |
| 49 | if w.Bots == nil { |
| 50 | w.Bots = make([]*Worker, 0) |
| 51 | } |
| 52 | w.incStarting() |
| 53 | w.Bots = append(w.Bots, &Worker{ |
| 54 | Client: client, |
| 55 | ID: w.starting, |
| 56 | Self: self, |
| 57 | log: w.log, |
| 58 | }) |
| 59 | w.log.Sugar().Info("Default bot loaded") |
| 60 | } |
| 61 | |
| 62 | func (w *BotWorkers) incStarting() { |
| 63 | w.mut.Lock() |
Tested by
no test coverage detected