summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/bwmarrin/discordgo/examples/mytoken
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/bwmarrin/discordgo/examples/mytoken')
-rw-r--r--vendor/github.com/bwmarrin/discordgo/examples/mytoken/main.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/vendor/github.com/bwmarrin/discordgo/examples/mytoken/main.go b/vendor/github.com/bwmarrin/discordgo/examples/mytoken/main.go
new file mode 100644
index 00000000..5914fc8a
--- /dev/null
+++ b/vendor/github.com/bwmarrin/discordgo/examples/mytoken/main.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "flag"
+ "fmt"
+
+ "github.com/bwmarrin/discordgo"
+)
+
+// Variables used for command line parameters
+var (
+ Email string
+ Password string
+)
+
+func init() {
+
+ flag.StringVar(&Email, "e", "", "Account Email")
+ flag.StringVar(&Password, "p", "", "Account Password")
+ flag.Parse()
+}
+
+func main() {
+
+ // Create a new Discord session using the provided login information.
+ dg, err := discordgo.New(Email, Password)
+ if err != nil {
+ fmt.Println("error creating Discord session,", err)
+ return
+ }
+
+ fmt.Printf("Your Authentication Token is:\n\n%s\n", dg.Token)
+}