diff options
| author | Hamidreza <70919649+hamid-gh98@users.noreply.github.com> | 2023-05-31 04:31:20 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-31 04:31:20 +0300 |
| commit | d694e6eafccad246c63264714897316f671d6428 (patch) | |
| tree | 55e7ead217c5a3e82791c0edae6ad44de1ba524f /web | |
| parent | 2a9cb6d29ebb8078f23201a3bc2767e66a7dbc98 (diff) | |
FIX tgbot adminIds
Diffstat (limited to 'web')
| -rw-r--r-- | web/service/tgbot.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/web/service/tgbot.go b/web/service/tgbot.go index 0ad7c3c6..d1a1e3fe 100644 --- a/web/service/tgbot.go +++ b/web/service/tgbot.go @@ -77,13 +77,15 @@ func (t *Tgbot) Start(i18nFS embed.FS) error { return err } - for _, adminId := range strings.Split(tgBotid, ",") { - id, err := strconv.Atoi(adminId) - if err != nil { - logger.Warning("Failed to get IDs from GetTgBotChatId:", err) - return err + if tgBotid != "" { + for _, adminId := range strings.Split(tgBotid, ",") { + id, err := strconv.Atoi(adminId) + if err != nil { + logger.Warning("Failed to get IDs from GetTgBotChatId:", err) + return err + } + adminIds = append(adminIds, int64(id)) } - adminIds = append(adminIds, int64(id)) } bot, err = telego.NewBot(tgBottoken) |
