Documentation ¶
Index ¶
Constants ¶
View Source
const ( MsgTypeCommon = "common" MsgTypeDirect = "direct" )
View Source
const ( RequestTypeGet = "get" RequestTypePostJsonObj = "post-json-obj" RequestTypePostJsonArray = "post-json-array" )
View Source
const (
ActionTypeProxy = "proxy"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
func (*Bot) InteractionRespond ¶
func (b *Bot) InteractionRespond(interaction *discordgo.Interaction, resp *discordgo.InteractionResponse)
type Cmd ¶
type Cmd interface { Meta() *discordgo.ApplicationCommand Handle(b *Bot, options map[string]interface{}, s *discordgo.Session, i *discordgo.InteractionCreate) Autocomplete(b *Bot, s *discordgo.Session, i *discordgo.InteractionCreate) }
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func (*Dispatcher) HandlerWebhook ¶
func (d *Dispatcher) HandlerWebhook(source string, body []byte, params interface{}, chCfg *SourceConfig) error
func (*Dispatcher) Proxy ¶
func (d *Dispatcher) Proxy(source string, body []byte, params interface{}, srcCfg *SourceConfig) error
func (*Dispatcher) ServeHTTP ¶
func (d *Dispatcher) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
func (*FileStore) AddSubscription ¶
func (s *FileStore) AddSubscription(sub *Subscription) error
func (*FileStore) FindSubscriptionsBySource ¶
func (s *FileStore) FindSubscriptionsBySource(source string) ([]*Subscription, error)
func (*FileStore) RemoveSubscription ¶
func (s *FileStore) RemoveSubscription(source string, userID string) (*Subscription, error)
type Interaction ¶
type Interaction struct { I *discordgo.Interaction R *discordgo.InteractionResponse }
type RequestType ¶
type RequestType string
type Scope ¶
type Scope struct { Raw string Sub *Subscription R interface{} Cfg *SourceConfig }
func (*Scope) MatchTokens ¶
type SourceConfig ¶
type SourceConfig struct { RequestType RequestType `json:"request_type" yaml:"request_type"` ActionType ActionType `json:"action_type" yaml:"action_type"` Template string `json:"template" yaml:"template"` FindPersonaExpr string `json:"find_persona_expr" yaml:"find_persona_expr"` SendAsEmbed bool `json:"send_as_embed" yaml:"send_as_embed"` }
type Store ¶
type Store interface { FindSubscriptionsBySource(source string) ([]*Subscription, error) AddSubscription(sub *Subscription) error RemoveSubscription(source string, userID string) (*Subscription, error) }
type SubscribeCmd ¶
type SubscribeCmd struct {
// contains filtered or unexported fields
}
func NewSubscribeCmd ¶
func NewSubscribeCmd(cfg *Config, store Store) *SubscribeCmd
func (*SubscribeCmd) Autocomplete ¶
func (c *SubscribeCmd) Autocomplete(b *Bot, _ *discordgo.Session, i *discordgo.InteractionCreate)
func (*SubscribeCmd) Handle ¶
func (c *SubscribeCmd) Handle(b *Bot, options map[string]interface{}, _ *discordgo.Session, i *discordgo.InteractionCreate)
func (*SubscribeCmd) Meta ¶
func (c *SubscribeCmd) Meta() *discordgo.ApplicationCommand
type Subscription ¶
type UnsubscribeCmd ¶
type UnsubscribeCmd struct {
// contains filtered or unexported fields
}
func NewUnsubscribeCmd ¶
func NewUnsubscribeCmd(cfg *Config, store Store) *UnsubscribeCmd
func (*UnsubscribeCmd) Autocomplete ¶
func (c *UnsubscribeCmd) Autocomplete(b *Bot, _ *discordgo.Session, i *discordgo.InteractionCreate)
func (*UnsubscribeCmd) Handle ¶
func (c *UnsubscribeCmd) Handle(b *Bot, options map[string]interface{}, _ *discordgo.Session, i *discordgo.InteractionCreate)
func (*UnsubscribeCmd) Meta ¶
func (c *UnsubscribeCmd) Meta() *discordgo.ApplicationCommand
Click to show internal directories.
Click to hide internal directories.