|
|
|
@ -99,3 +99,27 @@ var viewTrustLevel = adminOnly(func(s *discordgo.Session, m *discordgo.MessageCr
|
|
|
|
|
}
|
|
|
|
|
msg.Send(s, m.ChannelID)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var batchGiveRole = adminOnly(enforceDM(enforceArgumentCount(
|
|
|
|
|
config.BatchRoleUsage, 2,
|
|
|
|
|
func(s *discordgo.Session, m *discordgo.MessageCreate, command []string) {
|
|
|
|
|
members, err := backend.GetAllMembers(s)
|
|
|
|
|
if err != nil {
|
|
|
|
|
message.AuditError(s, m.ChannelID, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
for _, member := range members {
|
|
|
|
|
err := s.GuildMemberRoleAdd(
|
|
|
|
|
config.GuildID,
|
|
|
|
|
member.User.ID,
|
|
|
|
|
command[1],
|
|
|
|
|
)
|
|
|
|
|
if err != nil {
|
|
|
|
|
message.AuditError(s, m.ChannelID, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
message.InitNewEmbed(config.SuccessTitle, config.BatchRoleSuccessMessage, config.SuccessColour).
|
|
|
|
|
Send(s, m.ChannelID)
|
|
|
|
|
},
|
|
|
|
|
)))
|
|
|
|
|