-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
44 lines (41 loc) · 1.06 KB
/
main.go
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
package main
import (
"OwlGramServer/consts"
"OwlGramServer/crowdin"
"OwlGramServer/emoji"
"OwlGramServer/gopy"
"OwlGramServer/http/webserver"
"OwlGramServer/telegram/bot"
"OwlGramServer/telegram/checker"
"OwlGramServer/updates"
"OwlGramServer/utilities"
"os"
"os/exec"
)
var botClient *bot.Context
var tgChecker *checker.Context
var crowdinClient *crowdin.Context
var updatesClient *updates.Context
var emojiClient *emoji.Context
var pythonClient *gopy.Context
func main() {
consts.LoadEnv()
if _, err := os.Stat(consts.UploadsFolder); os.IsNotExist(err) {
_ = os.Mkdir(consts.UploadsFolder, 0775)
}
_ = exec.Command("chmod", "+x", consts.AAPT2ToolPath).Run()
pythonClient = utilities.SmartPythonBuild()
emojiClient = emoji.Client(pythonClient)
crowdinClient = crowdin.Client()
updatesClient = updates.Client()
botClient = bot.Bot(updatesClient, pythonClient)
if !consts.IsDebug {
tgChecker = checker.Client()
go tgChecker.Run()
}
go botClient.Run()
go emojiClient.Run()
go crowdinClient.Run()
go updatesClient.Run()
webserver.Client(handler).Run()
}