forked from pothtonswer/discordmuffin
Merge pull request #403 from jonas747/feature-bottest
Add bot account to testing
This commit is contained in:
commit
9d41d8595b
1 changed files with 10 additions and 2 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue