From a0b84beb9bae3514940a0cde40948e885184f555 Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 19 Sep 2016 20:53:26 +0200 Subject: Add Discord support --- .../bwmarrin/discordgo/examples/mytoken/main.go | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 vendor/github.com/bwmarrin/discordgo/examples/mytoken/main.go (limited to 'vendor/github.com/bwmarrin/discordgo/examples/mytoken') 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) +} -- cgit v1.2.3