Milen/commands/ignoreChannel.go

25 lines
708 B
Go

package commands
import (
"github.com/bwmarrin/discordgo"
"gitea.teamortix.com/chanbakjsd/Milen/persistent"
"gitea.teamortix.com/chanbakjsd/Milen/util"
)
func handleIgnoreChannel(dg *discordgo.Session, m *discordgo.MessageCreate, arguments []string) {
if !util.HasAdmin(dg, m.Author.ID, m.ChannelID) {
util.SendErrorEmbed(dg, m.ChannelID, util.ErrRequireAdmin)
return
}
persistent.IgnoredChannels[m.ChannelID] = true
}
func handleUnignoreChannel(dg *discordgo.Session, m *discordgo.MessageCreate, arguments []string) {
if !util.HasAdmin(dg, m.Author.ID, m.ChannelID) {
util.SendErrorEmbed(dg, m.ChannelID, util.ErrRequireAdmin)
return
}
delete(persistent.IgnoredChannels, m.ChannelID)
}