You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
593 B
38 lines
593 B
4 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"flag"
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/bwmarrin/discordgo"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
token string
|
||
|
dg *discordgo.Session
|
||
3 years ago
|
guild string
|
||
4 years ago
|
)
|
||
|
|
||
|
func init() {
|
||
|
flag.StringVar(&token, "t", "", "Bot Token")
|
||
3 years ago
|
flag.StringVar(&guild, "g", "", "Guild ID")
|
||
4 years ago
|
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()
|
||
3 years ago
|
runFunction()
|
||
4 years ago
|
dg.Close()
|
||
|
}
|
||
|
|
||
3 years ago
|
func runFunction() {
|
||
4 years ago
|
bans, _ := dg.GuildBans(guild)
|
||
|
for _, v := range bans {
|
||
|
dg.GuildBanDelete(guild, v.User.ID)
|
||
|
}
|
||
|
}
|