bot/discord.go

25 lines
584 B
Go
Raw Normal View History

2023-02-06 21:58:22 +01:00
package main
import (
"github.com/sirupsen/logrus"
"github.com/bwmarrin/discordgo"
)
func removeRole(discordClient *discordgo.Session, guildID string, userID string, roleID string, dryrun bool) {
if ! dryrun {
err := discordClient.GuildMemberRoleRemove(guild, userID, roleID)
if err != nil {
logrus.Error(err.Error())
}
}
}
func addRole(discordClient *discordgo.Session, guildID string, userID string, roleID string, dryrun bool) {
if ! dryrun {
err := discordClient.GuildMemberRoleAdd(guild, userID, roleID)
if err != nil {
logrus.Error(err.Error())
}
}
}