interactions

package
v0.0.0-...-5d4f9ca Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscordInteraction

type DiscordInteraction struct {
	ApplicationCommand *discordgo.ApplicationCommand
	ComponentID        string
	Handler            func(s *discordgo.Session, i *discordgo.InteractionCreate)
}

Specification for specific interactions

type DiscordInteractionWrapper

type DiscordInteractionWrapper struct {
	Disco               *domain.DiscoDomain
	SupabseAuth         *database.SupabaseAuth
	LoginInteractionMap *shared.SyncMap[*LoginInteraction]
	Commands            []*DiscordInteraction
	Components          []*DiscordInteraction
	SCWorker            *scworker.SCWorker
	Repo                *repository.Repository
	Clip                *clip.ClipService
}

Wrapper for all interactions

func NewDiscordInteractionWrapper

func NewDiscordInteractionWrapper(
	repo *repository.Repository,
	redis *database.RedisWrapper,
	supabase *database.SupabaseAuth,
	sMap *shared.SyncMap[chan requests.CogWebhookMessage],
	qThrottler *shared.UserQueueThrottlerMap,
	safetyChecker *utils.TranslatorSafetyChecker,
	track *analytics.AnalyticsService,
	LoginInteractionMap *shared.SyncMap[*LoginInteraction],
	MQClient queue.MQClient,
) *DiscordInteractionWrapper

Create new wrapper and register interactions

func (*DiscordInteractionWrapper) GetHandlerForCommand

func (w *DiscordInteractionWrapper) GetHandlerForCommand(command string) func(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*DiscordInteractionWrapper) GetHandlerForComponent

func (w *DiscordInteractionWrapper) GetHandlerForComponent(component string) func(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*DiscordInteractionWrapper) HandleTip

func (*DiscordInteractionWrapper) HandleUpscaleGeneration

func (c *DiscordInteractionWrapper) HandleUpscaleGeneration(s *discordgo.Session, i *discordgo.InteractionCreate, outputId uuid.UUID, number int)

Handle upscaling

func (*DiscordInteractionWrapper) NewAuthenticateCommand

func (c *DiscordInteractionWrapper) NewAuthenticateCommand() *DiscordInteraction

func (*DiscordInteractionWrapper) NewHelpCommand

func (c *DiscordInteractionWrapper) NewHelpCommand() *DiscordInteraction

func (*DiscordInteractionWrapper) NewImageCommand

func (c *DiscordInteractionWrapper) NewImageCommand() *DiscordInteraction

func (*DiscordInteractionWrapper) NewInfoCommand

func (c *DiscordInteractionWrapper) NewInfoCommand() *DiscordInteraction

func (*DiscordInteractionWrapper) NewUpscaleCommand

func (c *DiscordInteractionWrapper) NewUpscaleCommand() *DiscordInteraction

func (*DiscordInteractionWrapper) NewVoiceoverCommand

func (c *DiscordInteractionWrapper) NewVoiceoverCommand() *DiscordInteraction

type LoginInteraction

type LoginInteraction struct {
	Session     *discordgo.Session
	Interaction *discordgo.InteractionCreate
	InsertedAt  time.Time
}

Jump to

Keyboard shortcuts

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