File: telegram_token.go

package info (click to toggle)
golang-github-nicholas-fedor-shoutrrr 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,432 kB
  • sloc: sh: 74; makefile: 5
file content (10 lines) | stat: -rw-r--r-- 216 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
package telegram

import "regexp"

// IsTokenValid for use with telegram.
func IsTokenValid(token string) bool {
	matched, err := regexp.MatchString("^[0-9]+:[a-zA-Z0-9_-]+$", token)

	return matched && err == nil
}