discord

package
v0.0.0-...-6e8d5b8 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(s *discordgo.Session) error

func ErrorResponse

func ErrorResponse(s Session, i *discordgo.InteractionCreate, err error) error

func HandleInteractionCreate

func HandleInteractionCreate(commands map[string]*SlashCommand) func(*discordgo.Session, *discordgo.InteractionCreate)

func NewSession

func NewSession(token string, intents discordgo.Intent) (*discordgo.Session, error)

func Open

func OverwriteAndHandleCommands

func OverwriteAndHandleCommands(commands ...*SlashCommand) func(*discordgo.Session) (*discordgo.Session, error)

func OverwriteCommands

func OverwriteCommands(s *discordgo.Session, newCommands map[string]*SlashCommand) error

func UpdateStatus

func UpdateStatus(idle int, msg string) func(*discordgo.Session) (*discordgo.Session, error)

Types

type Handler

type Handler func(s Session, i *discordgo.InteractionCreate) error

type Session

type Session interface {
	InteractionRespond(i *discordgo.Interaction, ir *discordgo.InteractionResponse, opts ...discordgo.RequestOption) error
	FollowupMessageCreate(i *discordgo.Interaction, waitResponse bool, params *discordgo.WebhookParams, opts ...discordgo.RequestOption) (*discordgo.Message, error)
}

type SlashCommand

type SlashCommand struct {
	*discordgo.ApplicationCommand
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(command *discordgo.ApplicationCommand, handler Handler) *SlashCommand

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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