diff options
author | Wim <wim@42.be> | 2016-09-19 20:53:26 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2016-09-19 20:53:26 +0200 |
commit | a0b84beb9bae3514940a0cde40948e885184f555 (patch) | |
tree | 0e8d22c5e2292c24e46699e59f442795b6158b3a /vendor/github.com/bwmarrin/discordgo/examples/mytoken | |
parent | 0816e968318be5a4b165ac8fd30c032c6ecce61c (diff) | |
download | matterbridge-msglm-a0b84beb9bae3514940a0cde40948e885184f555.tar.gz matterbridge-msglm-a0b84beb9bae3514940a0cde40948e885184f555.tar.bz2 matterbridge-msglm-a0b84beb9bae3514940a0cde40948e885184f555.zip |
Add Discord support
Diffstat (limited to 'vendor/github.com/bwmarrin/discordgo/examples/mytoken')
-rw-r--r-- | vendor/github.com/bwmarrin/discordgo/examples/mytoken/main.go | 33 |
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) +} |