Fixed command invocation
This commit is contained in:
@ -15,6 +15,7 @@ var allCommands = []Command{
|
|||||||
commands.Play,
|
commands.Play,
|
||||||
commands.RandomQuote,
|
commands.RandomQuote,
|
||||||
commands.Region,
|
commands.Region,
|
||||||
|
commands.Roles,
|
||||||
commands.Source,
|
commands.Source,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
// AnimeList shows the link for the anime list of a user.
|
// AnimeList shows the link for the anime list of a user.
|
||||||
func AnimeList(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
func AnimeList(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
||||||
if strings.HasPrefix(msg.Content, "!animelist ") {
|
if !strings.HasPrefix(msg.Content, "!animelist ") {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
// AnimeSearch shows the link for the anime list of a user.
|
// AnimeSearch shows the link for the anime list of a user.
|
||||||
func AnimeSearch(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
func AnimeSearch(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
||||||
if strings.HasPrefix(msg.Content, "!a ") {
|
if !strings.HasPrefix(msg.Content, "!a ") {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
// Play changes the status of the bot.
|
// Play changes the status of the bot.
|
||||||
func Play(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
func Play(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
||||||
if strings.HasPrefix(msg.Content, "!play ") {
|
if !strings.HasPrefix(msg.Content, "!play ") {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,16 +7,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var regions = map[string]string{
|
var regions = map[string]string{
|
||||||
"africa": "465876853236826112",
|
"africa": "465387147629953034",
|
||||||
"america": "465876808311635979",
|
"america": "465386843706359840",
|
||||||
"asia": "465876834031108096",
|
"asia": "465386826006528001",
|
||||||
"australia": "465876893036707840",
|
"australia": "465387169888862230",
|
||||||
"europe": "465876773029019659",
|
"europe": "465386794914152448",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Region sets the specific region role for the user.
|
// Region sets the specific region role for the user.
|
||||||
func Region(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
func Region(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
||||||
if strings.HasPrefix(msg.Content, "!region ") {
|
if !strings.HasPrefix(msg.Content, "!region ") {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
25
bots/discord/commands/Roles.go
Normal file
25
bots/discord/commands/Roles.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package commands
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/bwmarrin/discordgo"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Guild ID
|
||||||
|
const guildID = "134910939140063232"
|
||||||
|
|
||||||
|
// Roles prints out all roles.
|
||||||
|
func Roles(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
||||||
|
if msg.Content != "!roles" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
roles, _ := s.GuildRoles(guildID)
|
||||||
|
|
||||||
|
for _, role := range roles {
|
||||||
|
s.ChannelMessageSend(msg.ChannelID, fmt.Sprintf("%s: %s", role.ID, role.Name))
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
Reference in New Issue
Block a user