From b668161bb584223f30a58cf13afcf5970fbbbb19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=97=D0=B0=D0=B6=D0=B8=D0=B3=D0=B8=D0=BD=20=D0=91=D0=BE?= =?UTF-8?q?=D0=B3=D0=B4=D0=B0=D0=BD=20=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Sun, 14 May 2023 01:36:22 +0300 Subject: [PATCH] Retrieve the token as an argument --- source/discord-telegraph/main.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 source/discord-telegraph/main.go diff --git a/source/discord-telegraph/main.go b/source/discord-telegraph/main.go new file mode 100644 index 0000000..06c6d75 --- /dev/null +++ b/source/discord-telegraph/main.go @@ -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) +}