-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
45 lines (39 loc) · 1.13 KB
/
Copy pathmain.go
File metadata and controls
45 lines (39 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"DiscordBot/weblens_api"
"log"
"os"
"DiscordBot/bot"
"github.com/joho/godotenv"
)
//TIP <p>To run your code, right-click the code and select <b>Run</b>.</p> <p>Alternatively, click
// the <icon src="AllIcons.Actions.Execute"/> icon in the gutter and select the <b>Run</b> menu item from here.</p>
func main() {
err := godotenv.Load(".env")
if err != nil {
log.Fatalf("Error loading .env file")
}
args := os.Args
if len(args) > 1 {
if args[1] == "--beta" {
weblens_api.ApiKey = os.Getenv("weblens_beta_key")
weblens_api.BaseURL = os.Getenv("weblens_api_url_beta")
weblens_api.HomeID = os.Getenv("beta_homeID")
bot.Debug = true
} else {
weblens_api.ApiKey = os.Getenv("weblens_api_key")
weblens_api.BaseURL = os.Getenv("weblens_api_url_base")
weblens_api.HomeID = os.Getenv("homeID")
bot.Debug = false
}
} else {
weblens_api.ApiKey = os.Getenv("weblens_api_key")
weblens_api.BaseURL = os.Getenv("weblens_api_url_base")
weblens_api.HomeID = os.Getenv("homeID")
}
token := os.Getenv("token")
bot.BotToken = token
guildID := os.Getenv("guild")
bot.GuildID = guildID
bot.Run()
}