main.go 680 B

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