Exemplo n.º 1
0
//Ban function calls the BanCreate api for discord and sets the warnning
//and banned information appropriatly
func (u *User) Ban(dg *discordgo.Session) (success bool, err error) {
	u.Banned = true
	u.BannedDate = time.Now()
	u.Warnings = 0
	err = dg.GuildBanCreate(u.Member.GuildID, u.Member.User.ID, 0)
	if err == nil {
		return true, nil
	}
	return false, nil
}
Exemplo n.º 2
0
//UnBan function calls the BanDelete api for discord and sets the warning and
//banned information appropriatly
func (u *User) UnBan(dg *discordgo.Session) {
	u.Banned = false
	u.Warnings = 0
	dg.GuildBanCreate(u.Member.GuildID, u.Member.User.ID, 0)
}