Documentation ¶
Index ¶
- Constants
- func CreateDiscordInteractionResponse(ctx context.Context, i *discordgo.InteractionCreate, s *discordgo.Session, ...)
- func CustomID(i discordgo.InteractionCreate, pos buttonPosition) (string, error)
- type ApologiesOption
- type DiscordError
- type DiscordEventHandler
- type DiscordMessageReceiver
- type DiscordOptionMatcher
- type DiscordSlashCommandHandler
- type JokeCommand
- type ListCommand
- type NextJokeOption
- type NextListCommandOption
- type PreviousListCommandOption
- type SameJokeCategoryOption
- type SimpleMessage
- type SpockCommand
- type StopCommand
- type WelcomeCommand
Constants ¶
View Source
const ( NextJokeButtonName = "nextJokeButtonId" SameJokeCategoryButtonName = "sameJokeButtonId" ApologiesButtonName = "apologiesButtonId" )
View Source
const (
GetJokeCommandName = "joke"
)
View Source
const ListCommandName = "list"
View Source
const (
SpockCommandName = "spock"
)
View Source
const StopCommandName = "stop"
View Source
const WelcomeCommandName = "welcome"
Variables ¶
This section is empty.
Functions ¶
func CreateDiscordInteractionResponse ¶
func CreateDiscordInteractionResponse(ctx context.Context, i *discordgo.InteractionCreate, s *discordgo.Session, msg DiscordMessageReceiver)
Types ¶
type ApologiesOption ¶
type ApologiesOption struct{}
func (ApologiesOption) Execute ¶
func (a ApologiesOption) Execute(_ context.Context, _ *discordgo.Session, _ *discordgo.InteractionCreate) (DiscordMessageReceiver, error)
func (ApologiesOption) Match ¶
func (a ApologiesOption) Match(customID string) bool
type DiscordError ¶
func (DiscordError) Error ¶
func (e DiscordError) Error() string
func (DiscordError) Response ¶
func (e DiscordError) Response() *discordgo.InteractionResponseData
type DiscordEventHandler ¶
type DiscordEventHandler interface {
Execute(ctx context.Context, s *discordgo.Session, i *discordgo.InteractionCreate) (DiscordMessageReceiver, error)
}
type DiscordMessageReceiver ¶
type DiscordMessageReceiver interface {
Response() *discordgo.InteractionResponseData
}
type DiscordOptionMatcher ¶
type DiscordSlashCommandHandler ¶
type DiscordSlashCommandHandler interface { Command() *discordgo.ApplicationCommand DiscordEventHandler }
type JokeCommand ¶
type JokeCommand struct {
Services []joke.SearchService
}
func (JokeCommand) Command ¶
func (j JokeCommand) Command() *discordgo.ApplicationCommand
func (JokeCommand) Execute ¶
func (j JokeCommand) Execute(ctx context.Context, _ *discordgo.Session, i *discordgo.InteractionCreate) (DiscordMessageReceiver, error)
type ListCommand ¶
type ListCommand struct {
// contains filtered or unexported fields
}
func NewListCommand ¶
func NewListCommand() *ListCommand
func (ListCommand) Command ¶
func (l ListCommand) Command() *discordgo.ApplicationCommand
func (ListCommand) Execute ¶
func (l ListCommand) Execute( ctx context.Context, _ *discordgo.Session, i *discordgo.InteractionCreate, ) (DiscordMessageReceiver, error)
type NextJokeOption ¶
type NextJokeOption struct {
Services []joke.SearchService
}
func (NextJokeOption) Execute ¶
func (n NextJokeOption) Execute(ctx context.Context, _ *discordgo.Session, i *discordgo.InteractionCreate) (DiscordMessageReceiver, error)
func (NextJokeOption) Match ¶
func (n NextJokeOption) Match(customID string) bool
type NextListCommandOption ¶
type NextListCommandOption struct {
CMD *ListCommand
}
func (NextListCommandOption) Execute ¶
func (n NextListCommandOption) Execute(ctx context.Context, _ *discordgo.Session, i *discordgo.InteractionCreate) (DiscordMessageReceiver, error)
func (NextListCommandOption) Match ¶
func (n NextListCommandOption) Match(customID string) bool
type PreviousListCommandOption ¶
type PreviousListCommandOption struct {
Cmd *ListCommand
}
func (PreviousListCommandOption) Execute ¶
func (p PreviousListCommandOption) Execute(ctx context.Context, _ *discordgo.Session, i *discordgo.InteractionCreate) (DiscordMessageReceiver, error)
func (PreviousListCommandOption) Match ¶
func (p PreviousListCommandOption) Match(customID string) bool
type SameJokeCategoryOption ¶
type SameJokeCategoryOption struct {
Services []joke.SearchService
}
func (SameJokeCategoryOption) Execute ¶
func (s SameJokeCategoryOption) Execute(ctx context.Context, _ *discordgo.Session, i *discordgo.InteractionCreate) (DiscordMessageReceiver, error)
func (SameJokeCategoryOption) Match ¶
func (s SameJokeCategoryOption) Match(customID string) bool
type SimpleMessage ¶
func (SimpleMessage) Response ¶
func (s SimpleMessage) Response() (msg *discordgo.InteractionResponseData)
type SpockCommand ¶
type SpockCommand struct { GlobalCtx context.Context MusicStopChs map[string]chan struct{} GuildVoiceChats map[string]voice.ChatInfo }
func (SpockCommand) Command ¶
func (sc SpockCommand) Command() *discordgo.ApplicationCommand
func (SpockCommand) Execute ¶
func (sc SpockCommand) Execute( ctx context.Context, s *discordgo.Session, i *discordgo.InteractionCreate, ) (DiscordMessageReceiver, error)
type StopCommand ¶
type StopCommand struct {
MusicStopChs map[string]chan struct{}
}
func (StopCommand) Command ¶
func (sc StopCommand) Command() *discordgo.ApplicationCommand
func (StopCommand) Execute ¶
func (sc StopCommand) Execute( ctx context.Context, s *discordgo.Session, i *discordgo.InteractionCreate, ) (res DiscordMessageReceiver, _ error)
type WelcomeCommand ¶
type WelcomeCommand struct{}
func (WelcomeCommand) Command ¶
func (w WelcomeCommand) Command() *discordgo.ApplicationCommand
func (WelcomeCommand) Execute ¶
func (w WelcomeCommand) Execute(_ context.Context, _ *discordgo.Session, i *discordgo.InteractionCreate) (DiscordMessageReceiver, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.