Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Commands = []*discordgo.ApplicationCommand{ { Name: "cat", Description: "Get yo-self a cat", }, { Name: "dog", Description: "Get yo-self a dog", }, { Name: "scatter", Description: "Fly! You fools!", }, { Name: "moms-home", Description: "HIDE! MOM'S HOME!", }, } CommandHandlers = map[string]func(session *discordgo.Session, i *discordgo.InteractionCreate){ "cat": catsHandler, "dog": dogsHandler, "scatter": scatterHandler, "moms-home": momsHandler, "followups": func(session *discordgo.Session, i *discordgo.InteractionCreate) { session.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ Flags: 1 << 6, Content: "Surprise!", }, }) msg, err := session.FollowupMessageCreate(session.State.User.ID, i.Interaction, true, &discordgo.WebhookParams{ Content: "Followup message has been created, after 5 seconds it will be edited", }) if err != nil { session.FollowupMessageCreate(session.State.User.ID, i.Interaction, true, &discordgo.WebhookParams{ Content: "Something went wrong", }) return } time.Sleep(time.Second * 5) session.FollowupMessageEdit(session.State.User.ID, i.Interaction, msg.ID, &discordgo.WebhookEdit{ Content: "Now the original message is gone and after 10 seconds this message will ~~self-destruct~~ be deleted.", }) time.Sleep(time.Second * 10) session.FollowupMessageDelete(session.State.User.ID, i.Interaction, msg.ID) session.FollowupMessageCreate(session.State.User.ID, i.Interaction, true, &discordgo.WebhookParams{ Content: "For those, who didn't skip anything and followed tutorial along fairly, " + "take a unicorn :unicorn: as reward!\n" + "Also, as bonus... look at the original interaction response :D", }) }, } )
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.