4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-27 15:49:23 +00:00

Update vendor

This commit is contained in:
Wim
2017-01-28 22:45:32 +01:00
parent 1426ddec5f
commit 79e6c9fa6c
33 changed files with 2800 additions and 2027 deletions

View File

@ -13,7 +13,7 @@ import (
)
func init() {
flag.StringVar(&token, "t", "", "Account Token")
flag.StringVar(&token, "t", "", "Bot Token")
flag.Parse()
}
@ -34,8 +34,8 @@ func main() {
return
}
// Create a new Discord session using the provided token.
dg, err := discordgo.New(token)
// Create a new Discord session using the provided bot token.
dg, err := discordgo.New("Bot " + token)
if err != nil {
fmt.Println("Error creating Discord session: ", err)
return
@ -102,7 +102,7 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
// This function will be called (due to AddHandler above) every time a new
// guild is joined.
func guildCreate(s *discordgo.Session, event *discordgo.GuildCreate) {
if event.Guild.Unavailable != nil {
if event.Guild.Unavailable {
return
}
@ -131,6 +131,10 @@ func loadSound() error {
// If this is the end of the file, just return.
if err == io.EOF || err == io.ErrUnexpectedEOF {
file.Close()
if err != nil {
return err
}
return nil
}

View File

@ -10,24 +10,19 @@ import (
// Variables used for command line parameters
var (
Email string
Password string
Token string
Token string
)
func init() {
flag.StringVar(&Email, "e", "", "Account Email")
flag.StringVar(&Password, "p", "", "Account Password")
flag.StringVar(&Token, "t", "", "Account Token")
flag.StringVar(&Token, "t", "", "Bot Token")
flag.Parse()
}
func main() {
// Create a new Discord session using the provided login information.
// Use discordgo.New(Token) to just use a token for login.
dg, err := discordgo.New(Email, Password, Token)
// Create a new Discord session using the provided bot token.
dg, err := discordgo.New("Bot " + Token)
if err != nil {
fmt.Println("error creating Discord session,", err)
return

View File

@ -9,24 +9,20 @@ import (
// Variables used for command line parameters
var (
Email string
Password string
Token string
BotID string
Token string
BotID string
)
func init() {
flag.StringVar(&Email, "e", "", "Account Email")
flag.StringVar(&Password, "p", "", "Account Password")
flag.StringVar(&Token, "t", "", "Account Token")
flag.StringVar(&Token, "t", "", "Bot Token")
flag.Parse()
}
func main() {
// Create a new Discord session using the provided login information.
dg, err := discordgo.New(Email, Password, Token)
// Create a new Discord session using the provided bot token.
dg, err := discordgo.New("Bot " + Token)
if err != nil {
fmt.Println("error creating Discord session,", err)
return