-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (36 loc) · 946 Bytes
/
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
package main
import (
"fmt"
"log"
"os"
"github.com/BurntSushi/toml"
"github.com/bwmarrin/discordgo"
"github.com/sirupsen/logrus"
)
type NukeAccount struct {
Session *discordgo.Session
Config NukeConfig
}
var logger = logrus.New()
func main() {
nukeAccount := NukeAccount{}
contents, err := os.ReadFile("nukeconf.toml")
if err != nil {
log.Fatalln(err)
}
if err := toml.Unmarshal(contents, &nukeAccount.Config); err != nil {
log.Fatalln("Error parsing config file: ", err)
}
logger.Infoln("initializing...")
session, _ := discordgo.New(nukeAccount.Config.Token)
session.Identify.Intents = discordgo.IntentsAllWithoutPrivileged | discordgo.IntentGuildMembers
nukeAccount.Session = session
if !nukeAccount.Config.FeatureConfig.AutoNuke.Enabled {
fmt.Println("Initialized with auto nuke off. Proceed with nuke (press enter)?")
fmt.Scanln()
}
err = nukeAccount.BeginNuke()
if err != nil {
logger.Infoln(err)
}
}