commands

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Commands = []*discordgo.ApplicationCommand{
		{
			Name:        "inspire",
			Description: "Summons Inspiration",
		},
	}
	CommandHandlers = map[string]func(s *discordgo.Session, i *discordgo.InteractionCreate){
		"inspire": func(s *discordgo.Session, i *discordgo.InteractionCreate) {
			bttp := util.NewBloopyClient()
			s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
				Type: discordgo.InteractionResponseChannelMessageWithSource,
				Data: &discordgo.InteractionResponseData{
					Embeds: []*discordgo.MessageEmbed{
						{
							Author: &discordgo.MessageEmbedAuthor{},
							Image: &discordgo.MessageEmbedImage{
								URL: bttp.Inspiro_api.GetInspiro(),
							},
						},
					},
				},
			})
		},
	}
)

Functions

func DirectMessageCreate

func DirectMessageCreate(s *discordgo.Session, m *discordgo.MessageCreate)

Listens for target command in channels Responds in DM to user

func IsNotDMCommand

func IsNotDMCommand(q string) bool

Temporary method to check if command is relevant

func MessageCreate

func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate)

This function will be called (due to AddHandler above) every time a new message is created on any channel that the authenticated bot has access to.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL