MCPcopy
hub / github.com/EverythingSuckz/TG-FileStreamBot / Add

Method Add

internal/bot/workers.go:68–83  ·  view source on GitHub ↗
(token string)

Source from the content-addressed store, hash-verified

66}
67
68func (w *BotWorkers) Add(token string) (err error) {
69 w.incStarting()
70 var botID int = w.starting
71 client, err := startWorker(w.log, token, botID)
72 if err != nil {
73 return err
74 }
75 w.log.Sugar().Infof("Bot @%s loaded with ID %d", client.Self.Username, botID)
76 w.Bots = append(w.Bots, &Worker{
77 Client: client,
78 ID: botID,
79 Self: client.Self,
80 log: w.log,
81 })
82 return nil
83}
84
85func GetNextWorker() *Worker {
86 Workers.mut.Lock()

Callers 2

StartWorkersFunction · 0.80
prefetchMethod · 0.80

Calls 2

incStartingMethod · 0.95
startWorkerFunction · 0.85

Tested by

no test coverage detected