25 lines
584 B
Go
25 lines
584 B
Go
|
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())
|
||
|
}
|
||
|
}
|
||
|
}
|