2018-07-10 16:04:58 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2019-06-05 05:56:12 +00:00
|
|
|
"github.com/akyoto/color"
|
2018-07-10 16:04:58 +00:00
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Guild ID
|
|
|
|
const guildID = "134910939140063232"
|
|
|
|
|
2018-07-10 16:06:34 +00:00
|
|
|
// Admin ID
|
|
|
|
const adminID = "122970452632141826"
|
|
|
|
|
|
|
|
// Roles prints out all roles for the server admin.
|
2018-07-10 16:04:58 +00:00
|
|
|
func Roles(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
2018-07-10 16:06:34 +00:00
|
|
|
if msg.Content != "!roles" || msg.Author.ID != adminID {
|
2018-07-10 16:04:58 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
roles, _ := s.GuildRoles(guildID)
|
|
|
|
|
|
|
|
for _, role := range roles {
|
2019-06-05 05:56:12 +00:00
|
|
|
_, err := s.ChannelMessageSend(msg.ChannelID, fmt.Sprintf("%s: %s", role.ID, role.Name))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
color.Red(err.Error())
|
|
|
|
}
|
2018-07-10 16:04:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true
|
|
|
|
}
|