bb/command/ping.go

24 lines
360 B
Go
Raw Normal View History

2022-07-26 14:28:02 +00:00
package command
import (
"strings"
"github.com/bwmarrin/discordgo"
log "github.com/sirupsen/logrus"
)
func PingHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
if m.Author.ID == s.State.User.ID {
return
}
if !strings.HasPrefix(m.Content, "!ping") {
return
}
log.Debug("received ping")
s.ChannelMessageSend(m.ChannelID, "pong")
}