29 lines
567 B
Go
29 lines
567 B
Go
package discord
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
"TerraOceanBot/discord/backend"
|
|
"TerraOceanBot/discord/modules"
|
|
)
|
|
|
|
func ProcessCommand(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|
if m.Author.ID == s.State.User.ID {
|
|
return
|
|
}
|
|
|
|
command := strings.Split(m.Content, " ")
|
|
for _, v := range modules.Commands {
|
|
if v.Name == strings.ToLower(command[0]) {
|
|
v.Handler(s, m, command)
|
|
return
|
|
}
|
|
}
|
|
}
|
|
|
|
func ProcessVoiceStateUpdate(s *discordgo.Session, vs *discordgo.VoiceStateUpdate) {
|
|
backend.VoiceStateUpdate(s, vs.VoiceState)
|
|
}
|