mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-26 17:22:21 +07:00
Refactor: Use any instead of interface{}
This commit is contained in:
+4
-12
@@ -20,6 +20,8 @@ import (
|
||||
"x-ui/web/locale"
|
||||
"x-ui/xray"
|
||||
|
||||
"slices"
|
||||
|
||||
"github.com/mymmrac/telego"
|
||||
th "github.com/mymmrac/telego/telegohandler"
|
||||
tu "github.com/mymmrac/telego/telegoutil"
|
||||
@@ -894,12 +896,7 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool
|
||||
}
|
||||
|
||||
func checkAdmin(tgId int64) bool {
|
||||
for _, adminId := range adminIds {
|
||||
if adminId == tgId {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(adminIds, tgId)
|
||||
}
|
||||
|
||||
func (t *Tgbot) SendAnswer(chatId int64, msg string, isAdmin bool) {
|
||||
@@ -1692,12 +1689,7 @@ func (t *Tgbot) notifyExhausted() {
|
||||
}
|
||||
|
||||
func int64Contains(slice []int64, item int64) bool {
|
||||
for _, s := range slice {
|
||||
if s == item {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(slice, item)
|
||||
}
|
||||
|
||||
func (t *Tgbot) onlineClients(chatId int64, messageID ...int) {
|
||||
|
||||
Reference in New Issue
Block a user