goMuffin/handler/messageCreate.go

24 lines
471 B
Go
Raw Normal View History

2024-08-01 20:37:18 +09:00
package handler
import (
2024-08-17 16:54:14 +09:00
"strings"
2024-08-01 20:37:18 +09:00
"github.com/bwmarrin/discordgo"
)
2024-08-17 16:54:14 +09:00
// MessageCreate is handlers of messageCreate event
2024-08-01 20:37:18 +09:00
func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
if m.Author.ID == s.State.User.ID && m.Author.Bot {
return
}
2024-08-17 16:54:14 +09:00
if strings.HasPrefix(m.Content, "머핀아 ") {
content := strings.TrimPrefix(m.Content, "머핀아 ")
if content == "안녕" {
s.ChannelMessageSend(m.ChannelID, "안녕")
}
} else {
return
2024-08-01 20:37:18 +09:00
}
}