update all command

This commit is contained in:
Владимир Фёдоров 2022-05-16 01:52:14 +07:00
parent 8f30d79c85
commit fc0eda218f
1 changed files with 11 additions and 3 deletions

12
main.go
View File

@ -83,9 +83,17 @@ func run() {
if strings.Contains(strings.ToLower(text), tag) { if strings.Contains(strings.ToLower(text), tag) {
users, _ := db.GetUsers(chatID) users, _ := db.GetUsers(chatID)
s := "@" + users[0] s := ""
for _, user := range users[1:] { i := 0
for _, user := range users {
if username == user {
continue
}
if i > 0 {
s += " "
}
s += "@" + user s += "@" + user
i++
} }
_, _ = bot.Send(tgbot.NewMessage(chatID, s)) _, _ = bot.Send(tgbot.NewMessage(chatID, s))
} }