main.go 580 B

123456789101112131415161718192021222324252627282930313233
  1. package main
  2. import (
  3. "flag"
  4. "fmt"
  5. "github.com/bwmarrin/discordgo"
  6. )
  7. // Variables used for command line parameters
  8. var (
  9. Email string
  10. Password string
  11. )
  12. func init() {
  13. flag.StringVar(&Email, "e", "", "Account Email")
  14. flag.StringVar(&Password, "p", "", "Account Password")
  15. flag.Parse()
  16. }
  17. func main() {
  18. // Create a new Discord session using the provided login information.
  19. dg, err := discordgo.New(Email, Password)
  20. if err != nil {
  21. fmt.Println("error creating Discord session,", err)
  22. return
  23. }
  24. fmt.Printf("Your Authentication Token is:\n\n%s\n", dg.Token)
  25. }