Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accessory ¶
type Accessory struct {
Type string `json:"type"`
Image string `json:"image_url"`
Alt string `json:"alt_text"`
}
Accessory Slack's model
type Actions ¶
type Actions struct {
Type string `json:"type"`
BlockID string `json:"block_id,omitempty"`
Elements []Element `json:"elements"`
}
Actions response for slack
func NewActions ¶
NewActions creates Actions
type App ¶
type App struct {
// contains filtered or unexported fields
}
App of package
func New ¶
func New(config Config, command CommandHandler, interact InteractHandler, tracer trace.Tracer) App
New creates new App from Config
type ButtonElement ¶
type ButtonElement struct {
Type string `json:"type"`
Text Text `json:"text"`
ActionID string `json:"action_id"`
Value string `json:"value,omitempty"`
Style string `json:"style,omitempty"`
}
ButtonElement response for slack
type CommandHandler ¶
type CommandHandler func(context.Context, SlashPayload) Response
CommandHandler for handling when user send a slash command
type Context ¶ added in v0.0.10
Context response for slack
func (Context) AddElement ¶ added in v0.0.10
AddElement add given element to context
type Element ¶
type Element any
Element response for slack
func NewButtonElement ¶
NewButtonElement creates ButtonElement
type Image ¶ added in v0.0.15
type Image struct {
Type string `json:"type"`
Image string `json:"image_url"`
Alt string `json:"alt_text"`
Title Text `json:"title"`
}
Image Slack's model
type InteractHandler ¶
type InteractHandler func(context.Context, InteractivePayload) Response
InteractHandler for handling when user interact with a button
type InteractiveAction ¶
type InteractiveAction struct {
Type string `json:"type"`
BlockID string `json:"block_id,omitempty"`
ActionID string `json:"action_id,omitempty"`
Value string `json:"value,omitempty"`
}
InteractiveAction response from slack
type InteractivePayload ¶
type InteractivePayload struct {
User struct {
ID string `json:"id"`
} `json:"user"`
Container struct {
ChannelID string `json:"channel_id"`
} `json:"container"`
Type string `json:"type"`
ResponseURL string `json:"response_url"`
Actions []InteractiveAction `json:"actions"`
}
InteractivePayload response from slack
type Response ¶
type Response struct {
ResponseType string `json:"response_type,omitempty"`
Text string `json:"text,omitempty"`
Blocks []Block `json:"blocks,omitempty"`
ReplaceOriginal bool `json:"replace_original,omitempty"`
DeleteOriginal bool `json:"delete_original,omitempty"`
}
Response response content
func NewEphemeralMessage ¶
NewEphemeralMessage creates ephemeral text response
func NewResponse ¶ added in v0.0.5
NewResponse creates text response
func (Response) WithDeleteOriginal ¶ added in v0.0.6
WithDeleteOriginal set delete original to true
func (Response) WithReplaceOriginal ¶ added in v0.0.6
WithReplaceOriginal set replace original to true
type Section ¶
type Section struct {
Accessory *Accessory `json:"accessory,omitempty"`
Text Text `json:"text"`
Type string `json:"type"`
Fields []Text `json:"fields,omitempty"`
}
Section response for slack
func (Section) WithAccessory ¶ added in v0.0.5
WithAccessory set accessory for section