30 lines
501 B
Go
30 lines
501 B
Go
package commands
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
"PermissionGacha/modules/config"
|
|
)
|
|
|
|
func Parse(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|
if m.Author.Bot {
|
|
return
|
|
}
|
|
|
|
if !strings.HasPrefix(strings.ToLower(m.Content), config.CommandPrefix) {
|
|
return
|
|
}
|
|
|
|
commands := strings.Split(m.Content[len(config.CommandPrefix):], " ")
|
|
first := strings.ToLower(commands[0])
|
|
|
|
for _, v := range list {
|
|
if v.Name == first {
|
|
v.Handler(s, commands, m)
|
|
return
|
|
}
|
|
}
|
|
}
|