initial code commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package commands
|
||||
|
||||
import "github.com/bwmarrin/discordgo"
|
||||
|
||||
var BoopCommand = &discordgo.ApplicationCommand{
|
||||
Name: "boop",
|
||||
Description: "Say Boop!",
|
||||
}
|
||||
|
||||
func HandleBoop(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
var username string
|
||||
if i.Member != nil {
|
||||
username = i.Member.User.Username
|
||||
} else if i.User != nil {
|
||||
username = i.User.Username
|
||||
}
|
||||
response := &discordgo.InteractionResponse{
|
||||
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
||||
Data: &discordgo.InteractionResponseData{
|
||||
Content: username + ", Boop!",
|
||||
},
|
||||
}
|
||||
s.InteractionRespond(i.Interaction, response)
|
||||
}
|
||||
Reference in New Issue
Block a user