ticket-pimp/client/discord/handler/handle_ping.go

31 lines
638 B
Go

package handler
import (
"log"
"github.com/bwmarrin/discordgo"
)
func (h *router) Ping() route {
return route{
Command: discordgo.ApplicationCommand{
Name: "ping",
Description: "pongs in a reply",
},
Handler: func(s *discordgo.Session, i *discordgo.InteractionCreate) {
log.Println("ok, I'm here..")
err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{
Content: "`pong`",
Title: "Pong reply",
},
})
if err != nil {
log.Println(err)
}
},
}
}