package main

import (
	"flag"
	"fmt"

	"github.com/bwmarrin/discordgo"
)

var (
	token      string
	dg         *discordgo.Session
	guild     	string
)

func init() {
	flag.StringVar(&token, "t", "", "Bot Token")
	flag.StringVar(&guild, "g", "", "Guild ID")
	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()
	runFunction()
	dg.Close()
}

func runFunction() {
	bans, _ := dg.GuildBans(guild)
	for _, v := range bans {
		dg.GuildBanDelete(guild, v.User.ID)
	}
}