Merge pull request #403 from jonas747/feature-bottest

Add bot account to testing
This commit is contained in:
Bruce 2017-07-09 21:36:30 -05:00 committed by GitHub
commit 9d41d8595b

View file

@ -11,9 +11,11 @@ import (
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////// VARS NEEDED FOR TESTING ////////////////////////////////////////////////////// VARS NEEDED FOR TESTING
var ( var (
dg *Session // Stores global discordgo session dg *Session // Stores a global discordgo user session
dgBot *Session // Stores a global discordgo bot session
envToken = os.Getenv("DG_TOKEN") // Token to use when authenticating envToken = os.Getenv("DG_TOKEN") // Token to use when authenticating the user account
envBotToken = os.Getenv("DGB_TOKEN") // Token to use when authenticating the bot account
envEmail = os.Getenv("DG_EMAIL") // Email to use when authenticating envEmail = os.Getenv("DG_EMAIL") // Email to use when authenticating
envPassword = os.Getenv("DG_PASSWORD") // Password to use when authenticating envPassword = os.Getenv("DG_PASSWORD") // Password to use when authenticating
envGuild = os.Getenv("DG_GUILD") // Guild ID to use for tests envGuild = os.Getenv("DG_GUILD") // Guild ID to use for tests
@ -23,6 +25,12 @@ var (
) )
func init() { func init() {
if envBotToken != "" {
if d, err := New(envBotToken); err == nil {
dgBot = d
}
}
if envEmail == "" || envPassword == "" || envToken == "" { if envEmail == "" || envPassword == "" || envToken == "" {
return return
} }