Debian Codegraph @

pkg/services/chat/telegram/telegram_token.go

raw
1 package telegram
2
3 import "regexp"
4
5 // IsTokenValid for use with telegram.
6 func IsTokenValid(token string) bool {
7 matched, err := regexp.MatchString("^[0-9]+:[a-zA-Z0-9_-]+$", token)
8
9 return matched && err == nil
10 }