mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 13:32:24 +00:00
Update tgbot.go
This commit is contained in:
parent
5a22b5721b
commit
2844a1c33e
1 changed files with 18 additions and 1 deletions
|
@ -468,4 +468,21 @@ func (t *Tgbot) answerCommand(message *telego.Message, chatId int64, isAdmin boo
|
||||||
}
|
}
|
||||||
|
|
||||||
if msg != "" {
|
if msg != "" {
|
||||||
t.sendResponse(chatId
|
t.sendResponse(chatId, msg, onlyMessage, isAdmin)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to send the message based on onlyMessage flag.
|
||||||
|
func (t *Tgbot) sendResponse(chatId int64, msg string, onlyMessage, isAdmin bool) {
|
||||||
|
if onlyMessage {
|
||||||
|
t.SendMsgToTgbot(chatId, msg)
|
||||||
|
} else {
|
||||||
|
t.SendAnswer(chatId, msg, isAdmin)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *Tgbot) randomLowerAndNum(length int) string {
|
||||||
|
charset := "abcdefghijklmnopqrstuvwxyz0123456789"
|
||||||
|
bytes := make([]byte, length)
|
||||||
|
for i := range bytes {
|
||||||
|
randomIndex
|
||||||
|
|
Loading…
Reference in a new issue