Retrieve the token as an argument
This commit is contained in:
parent
2f5e8675ee
commit
b668161bb5
1 changed files with 21 additions and 0 deletions
21
source/discord-telegraph/main.go
Normal file
21
source/discord-telegraph/main.go
Normal 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)
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue