Retrieve the token as an argument

This commit is contained in:
bogdan zažigin 2023-05-14 01:36:22 +03:00
parent 2f5e8675ee
commit b668161bb5
Signed by: zaboal
GPG key ID: C9918166D559FE8A

View file

@ -0,0 +1,21 @@
package main
import (
"flag"
"log"
)
// Token — an authorization token to Discord API for bots
var (
Token string
)
// Retrieve the passed arguments on run
func init() {
flag.StringVar(&Token, "token", "", "Authorization token to Discord API for bots")
flag.Parse()
}
func main() {
log.Println("Got the token:", Token)
}