Remove react
This commit is contained in:
38
tools/unban.go
Normal file
38
tools/unban.go
Normal file
@ -0,0 +1,38 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
)
|
||||
|
||||
var (
|
||||
token string
|
||||
configFile string
|
||||
dg *discordgo.Session
|
||||
guild = "451553644161138712"
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&token, "t", "", "Bot Token")
|
||||
flag.StringVar(&configFile, "c", "", "Config file")
|
||||
flag.Parse()
|
||||
}
|
||||
|
||||
func main() {
|
||||
if token == "" {
|
||||
fmt.Printf("No token provided. Please run: disgord-thanos -t <bot token>")
|
||||
}
|
||||
dg, _ = discordgo.New("Bot " + token)
|
||||
_ = dg.Open()
|
||||
unbanAll()
|
||||
dg.Close()
|
||||
}
|
||||
|
||||
func unbanAll() {
|
||||
bans, _ := dg.GuildBans(guild)
|
||||
for _, v := range bans {
|
||||
dg.GuildBanDelete(guild, v.User.ID)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user