-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
61 lines (55 loc) · 1.28 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package main
import (
wtn "WTN-Sniper/src/module/WTN"
"WTN-Sniper/src/packages/file_manager"
console_logger "WTN-Sniper/src/packages/logger"
"WTN-Sniper/src/packages/menu"
"fmt"
"os"
"time"
)
var l = console_logger.New("Dashboard", true)
func main() {
if !file_manager.CheckSetup() {
l.Error("Error while checking the bot setup!")
time.Sleep(20 * time.Second)
os.Exit(1)
}
settingsData, err := file_manager.ReadSettings()
if err != nil {
l.Error(err.Error())
time.Sleep(20 * time.Second)
os.Exit(1)
}
fmt.Println("")
// We can now boot up the bot
l.Clear()
console_logger.PrintLogo()
for {
choice := menu.DashboardMenu("YOUR_NAME")
switch choice {
case "WTN":
proxyFile, err := file_manager.ReadProxies("Proxies")
if err != nil {
l.Error(err.Error())
time.Sleep(20 * time.Second)
os.Exit(1)
}
wtn.InitWtn(proxyFile, settingsData)
time.Sleep(5 * time.Second)
case "TEST":
testResults := wtn.TestWebhook(settingsData)
if testResults {
l.General("Webhooks tested!")
} else {
l.Warning("An error occured while testing the webhooks!")
time.Sleep(5 * time.Second)
}
time.Sleep(5 * time.Second)
default:
// Uscirà solo in caso di errore nell'input
fmt.Println("Invalid selection! Exiting...")
os.Exit(1)
}
}
}