This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
PermissionGacha/modules/commands/listener.go

29 lines
465 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(m.Content, config.CommandPrefix) {
return
}
commands := strings.Split(strings.TrimPrefix(m.Content, config.CommandPrefix), " ")
for _, v := range list {
if v.Name == commands[0] {
v.Handler(s, commands, m)
return
}
}
}