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:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-03-17 19:07:49 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-03-17 19:07:49 +0300
commit96786c94189f3d2f3f04c1915529c786228bdf42 (patch)
tree879085e09a3cd485f3246f46be907fe77eb84a1a /main.go
parentbc56e637376142c370c31b17558fc3778a863bd2 (diff)
alireza
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.go b/main.go
index f5da0704..d857ab46 100644
--- a/main.go
+++ b/main.go
@@ -136,7 +136,7 @@ func updateTgbotEnableSts(status bool) {
return
}
-func updateTgbotSetting(tgBotToken string, tgBotChatid int, tgBotRuntime string) {
+func updateTgbotSetting(tgBotToken string, tgBotChatid string, tgBotRuntime string) {
err := database.InitDB(config.GetDBPath())
if err != nil {
fmt.Println(err)
@@ -165,7 +165,7 @@ func updateTgbotSetting(tgBotToken string, tgBotChatid int, tgBotRuntime string)
}
}
- if tgBotChatid != 0 {
+ if tgBotChatid != "" {
err := settingService.SetTgBotChatId(tgBotChatid)
if err != nil {
fmt.Println(err)
@@ -224,7 +224,7 @@ func main() {
var username string
var password string
var tgbottoken string
- var tgbotchatid int
+ var tgbotchatid string
var enabletgbot bool
var tgbotRuntime string
var reset bool
@@ -236,7 +236,7 @@ func main() {
settingCmd.StringVar(&password, "password", "", "set login password")
settingCmd.StringVar(&tgbottoken, "tgbottoken", "", "set telegrame bot token")
settingCmd.StringVar(&tgbotRuntime, "tgbotRuntime", "", "set telegrame bot cron time")
- settingCmd.IntVar(&tgbotchatid, "tgbotchatid", 0, "set telegrame bot chat id")
+ settingCmd.StringVar(&tgbotchatid, "tgbotchatid", "", "set telegrame bot chat id")
settingCmd.BoolVar(&enabletgbot, "enabletgbot", false, "enable telegram bot notify")
oldUsage := flag.Usage
@@ -287,7 +287,7 @@ func main() {
if show {
showSetting(show)
}
- if (tgbottoken != "") || (tgbotchatid != 0) || (tgbotRuntime != "") {
+ if (tgbottoken != "") || (tgbotchatid != "") || (tgbotRuntime != "") {
updateTgbotSetting(tgbottoken, tgbotchatid, tgbotRuntime)
}
default: