goMuffin/handler/messageCreate.go
2024-08-17 16:54:14 +09:00

23 lines
471 B
Go

package handler
import (
"strings"
"github.com/bwmarrin/discordgo"
)
// MessageCreate is handlers of messageCreate event
func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
if m.Author.ID == s.State.User.ID && m.Author.Bot {
return
}
if strings.HasPrefix(m.Content, "머핀아 ") {
content := strings.TrimPrefix(m.Content, "머핀아 ")
if content == "안녕" {
s.ChannelMessageSend(m.ChannelID, "안녕")
}
} else {
return
}
}