mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-13 21:13:09 +00:00
small changes
This commit is contained in:
@@ -11,8 +11,7 @@
|
||||
|
||||
**If you think this project is helpful to you, you may wish to give a**:star2:
|
||||
|
||||
<img width="125" alt="image"
|
||||
src="https://github.com/alireza0/x-ui/assets/115543613/dd4f10dd-8bb0-40cf-846f-1fe1de7a6275">
|
||||
[](https://www.buymeacoffee.com/alireza7)
|
||||
|
||||
- USDT (TRC20): `TYTq73Gj6dJ67qe58JVPD9zpjW2cc9XgVz`
|
||||
- Tezos (XTZ):
|
||||
|
||||
2
main.go
2
main.go
@@ -318,7 +318,7 @@ func main() {
|
||||
updateTgbotEnableSts(enabletgbot)
|
||||
}
|
||||
default:
|
||||
fmt.Println("except 'run' or 'setting' subcommands")
|
||||
fmt.Println("Invalid subcommands")
|
||||
fmt.Println()
|
||||
runCmd.Usage()
|
||||
fmt.Println()
|
||||
|
||||
@@ -148,7 +148,7 @@ func (a *InboundController) addInboundClient(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
jsonMsg(c, "Client(s) added", nil)
|
||||
if err == nil && needRestart {
|
||||
if needRestart {
|
||||
a.xrayService.SetToNeedRestart()
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ func (a *InboundController) delInboundClient(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
jsonMsg(c, "Client deleted", nil)
|
||||
if err == nil && needRestart {
|
||||
if needRestart {
|
||||
a.xrayService.SetToNeedRestart()
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ func (a *InboundController) updateInboundClient(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
jsonMsg(c, "Client updated", nil)
|
||||
if err == nil && needRestart {
|
||||
if needRestart {
|
||||
a.xrayService.SetToNeedRestart()
|
||||
}
|
||||
}
|
||||
@@ -213,7 +213,7 @@ func (a *InboundController) resetClientTraffic(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
jsonMsg(c, "traffic reseted", nil)
|
||||
if err == nil && needRestart {
|
||||
if needRestart {
|
||||
a.xrayService.SetToNeedRestart()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -941,7 +941,7 @@ func (s *InboundService) disableInvalidInbounds(tx *gorm.DB) (bool, int64, error
|
||||
s.xrayApi.Init(p.GetAPIPort())
|
||||
for _, tag := range tags {
|
||||
err1 := s.xrayApi.DelInbound(tag)
|
||||
if err == nil {
|
||||
if err1 == nil {
|
||||
logger.Debug("Inbound disabled by api:", tag)
|
||||
} else {
|
||||
logger.Debug("Error in disabling inbound by api:", err1)
|
||||
|
||||
@@ -132,7 +132,7 @@ func (t *Tgbot) OnReceive() {
|
||||
isAdmin := checkAdmin(tgId)
|
||||
if update.Message == nil {
|
||||
if update.CallbackQuery != nil {
|
||||
t.asnwerCallback(update.CallbackQuery, isAdmin)
|
||||
t.asnwerCallback(update.CallbackQuery)
|
||||
}
|
||||
} else {
|
||||
if update.Message.IsCommand() {
|
||||
@@ -193,7 +193,7 @@ func (t *Tgbot) answerCommand(message *tgbotapi.Message, chatId int64, isAdmin b
|
||||
t.SendAnswer(chatId, msg, isAdmin)
|
||||
}
|
||||
|
||||
func (t *Tgbot) asnwerCallback(callbackQuery *tgbotapi.CallbackQuery, isAdmin bool) {
|
||||
func (t *Tgbot) asnwerCallback(callbackQuery *tgbotapi.CallbackQuery) {
|
||||
// Respond to the callback query, telling Telegram to show the user
|
||||
// a message with the data received.
|
||||
callback := tgbotapi.NewCallback(callbackQuery.ID, callbackQuery.Data)
|
||||
|
||||
Reference in New Issue
Block a user