2023-01-24 23:17:30 +03:00
|
|
|
package main
|
|
|
|
|
2023-02-10 17:00:50 +03:00
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"git.nefrace.ru/nefrace/nechotron"
|
|
|
|
)
|
2023-01-24 23:17:30 +03:00
|
|
|
|
|
|
|
func StringHasAny(s string, subs ...string) bool {
|
|
|
|
for _, sub := range subs {
|
|
|
|
if strings.Contains(s, sub) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func StringHasPrefix(s string, subs ...string) bool {
|
|
|
|
for _, sub := range subs {
|
|
|
|
if strings.HasPrefix(s, sub) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
func StringHasSuffix(s string, subs ...string) bool {
|
|
|
|
for _, sub := range subs {
|
|
|
|
if strings.HasSuffix(s, sub) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
2023-02-10 17:00:50 +03:00
|
|
|
|
|
|
|
func waitAndDelete(u *nechotron.Update, chatId int64, messageId int) {
|
|
|
|
time.Sleep(10 * time.Second)
|
|
|
|
u.Bot.DeleteMessage(chatId, messageId)
|
|
|
|
}
|