Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHamidreza <70919649+hamid-gh98@users.noreply.github.com>2023-05-31 04:31:20 +0300
committerGitHub <noreply@github.com>2023-05-31 04:31:20 +0300
commitd694e6eafccad246c63264714897316f671d6428 (patch)
tree55e7ead217c5a3e82791c0edae6ad44de1ba524f /web/service
parent2a9cb6d29ebb8078f23201a3bc2767e66a7dbc98 (diff)
FIX tgbot adminIds
Diffstat (limited to 'web/service')
-rw-r--r--web/service/tgbot.go14
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)