Documentation ¶
Index ¶
- func MakeInteractionHttpHandlerFunc(f func(Interaction) (*Response, error)) http.HandlerFunc
- func MakeJobHttpHandlerFunc(f func(Job) (*Response, error)) http.HandlerFunc
- func MakeRequestHttpHandlerFunc(f func(Request) (*Response, error)) http.HandlerFunc
- type ActionsRow
- type Application
- type Button
- type ComponentEmoji
- type Components
- type Embed
- type EmbedAuthor
- type EmbedField
- type EmbedFooter
- type Error
- type File
- type Intent
- type Interaction
- type Job
- type JwtClaims
- type Message
- type Reaction
- type Request
- type Response
- type Schedule
- type SelectMenu
- type SelectMenuOption
- type Server
- type TextInput
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeInteractionHttpHandlerFunc ¶ added in v0.3.9
func MakeInteractionHttpHandlerFunc(f func(Interaction) (*Response, error)) http.HandlerFunc
func MakeJobHttpHandlerFunc ¶ added in v0.1.0
func MakeJobHttpHandlerFunc(f func(Job) (*Response, error)) http.HandlerFunc
func MakeRequestHttpHandlerFunc ¶ added in v0.1.0
func MakeRequestHttpHandlerFunc(f func(Request) (*Response, error)) http.HandlerFunc
Types ¶
type ActionsRow ¶ added in v0.3.7
type ActionsRow struct { Buttons []*Button `json:"buttons,omitempty" yaml:"buttons,omitempty"` SelectMenus []*SelectMenu `json:"selectMenus,omitempty" yaml:"selectMenus,omitempty"` TextInputs []*TextInput `json:"textInputs,omitempty" yaml:"textInputs,omitempty"` }
type Application ¶ added in v0.3.1
type Application struct { Id string `json:"id,omitempty" yaml:"id,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Icon string `json:"icon,omitempty" yaml:"icon,omitempty"` Owner User `json:"owner,omitempty" yaml:"owner,omitempty"` }
type Button ¶ added in v0.3.7
type Button struct { Label string `json:"label" yaml:"label,omitempty"` Style uint `json:"style" yaml:"style,omitempty"` Disabled bool `json:"disabled" yaml:"disabled,omitempty"` Emoji ComponentEmoji `json:"emoji" yaml:"emoji,omitempty"` Url string `json:"url,omitempty" yaml:"url,omitempty"` CustomId string `json:"customId,omitempty" yaml:"customId,omitempty"` }
type ComponentEmoji ¶ added in v0.3.7
type Components ¶ added in v0.3.7
type Components struct { ActionsRows []*ActionsRow `json:"actionsRows,omitempty" yaml:"actionsRows,omitempty"` Buttons []*Button `json:"buttons,omitempty" yaml:"buttons,omitempty"` SelectMenus []*SelectMenu `json:"selectMenus,omitempty" yaml:"selectMenus,omitempty"` TextInputs []*TextInput `json:"textInputs,omitempty" yaml:"textInputs,omitempty"` }
type Embed ¶
type Embed struct { Url string `json:"url,omitempty" yaml:"url,omitempty"` Title string `json:"title,omitempty" yaml:"title,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Timestamp string `json:"timestamp,omitempty" yaml:"timestamp,omitempty"` Color int `json:"color,omitempty" yaml:"color,omitempty"` ImageUrl string `json:"imageUrl,omitempty" yaml:"imageUrl,omitempty"` ThumbnailUrl string `json:"thumbnailUrl,omitempty" yaml:"thumbnailUrl,omitempty"` VideoUrl string `json:"videoUrl,omitempty" yaml:"videoUrl,omitempty"` Author *EmbedAuthor `json:"author,omitempty" yaml:"author,omitempty"` Fields []*EmbedField `json:"fields,omitempty" yaml:"fields,omitempty"` }
type EmbedAuthor ¶
type EmbedField ¶
type EmbedFooter ¶
type EmbedFooter struct {}
type Error ¶ added in v0.0.2
type Error struct {
Message string `json:"message,omitempty" yaml:"message,omitempty"`
}
type Intent ¶ added in v0.3.3
type Intent struct { Id string `json:"id,omitempty" yaml:"id,omitempty"` ServerID string `json:"serverId,omitempty" yaml:"serverId,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Regex string `json:"regex,omitempty" yaml:"regex,omitempty"` Mention bool `json:"mention,omitempty" yaml:"mention,omitempty"` Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` Help string `json:"help,omitempty" yaml:"help,omitempty"` Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` Type string `json:"type,omitempty" yaml:"type,omitempty"` Response *Response `json:"response,omitempty" yaml:"response,omitempty"` }
type Interaction ¶ added in v0.3.9
type Interaction struct { Identifier string `json:"identifier,omitempty" yaml:"identifier,omitempty"` Source string `json:"source,omitempty" yaml:"source,omitempty"` MessageId string `json:"messageId,omitempty" yaml:"messageId,omitempty"` Bot User `json:"bot,omitempty" yaml:"bot,omitempty"` User User `json:"user,omitempty" yaml:"user,omitempty"` ChannelId string `json:"channelId,omitempty" yaml:"channelId,omitempty"` ServerId string `json:"serverId,omitempty" yaml:"serverId,omitempty"` IsDirect bool `json:"isDirect,omitempty" yaml:"isDirect,omitempty"` Values []string `json:"values,omitempty" yaml:"values,omitempty"` Type string `json:"type,omitempty" yaml:"type,omitempty"` }
type Job ¶ added in v0.0.4
type Job struct { Id string `json:"id,omitempty" yaml:"id,omitempty"` UserId string `json:"userId,omitempty" yaml:"userId,omitempty"` InstanceId string `json:"instanceId,omitempty" yaml:"instanceId,omitempty"` Source string `json:"source,omitempty" yaml:"source,omitempty"` Content string `json:"content,omitempty" yaml:"content,omitempty"` Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` Destination string `json:"destination,omitempty" yaml:"destination,omitempty"` Schedule Schedule `json:"schedule,omitempty" yaml:"schedule,omitempty"` Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` Created int32 `json:"created,omitempty" yaml:"created,omitempty"` }
type JwtClaims ¶ added in v0.3.5
type JwtClaims struct { jwt.StandardClaims ContextId string `json:"ctx,omitempty"` IntentId string `json:"iid,omitempty"` AuthorId string `json:"aid,omitempty"` ChannelId string `json:"cid,omitempty"` ServerId string `json:"sid,omitempty"` Platform string `json:"plt,omitempty"` }
JwtClaims represents custom jwt claims for treediagram
func ParseJwtClaims ¶ added in v0.3.5
ParseJwtClaims parses claims from and validates a string token
func (JwtClaims) SignedTokenString ¶ added in v0.3.5
SignedTokenString generates a signed jwt token string
type Message ¶
type Message struct { Content string `json:"content,omitempty" yaml:"content,omitempty"` Embed *Embed `json:"embed,omitempty" yaml:"embed,omitempty"` Reactions []string `json:"reactions,omitempty" yaml:"reactions,omitempty"` Files []*File `json:"files,omitempty" yaml:"files,omitempty"` Compontents *Components `json:"components,omitempty" yaml:"components,omitempty"` Tts bool `json:"tts,omitempty" yaml:"tts,omitempty"` IsPrivateMessage bool `json:"isPrivateMessage,omitempty" yaml:"isPrivateMessage,omitempty"` IsRedirect bool `json:"isRedirect,omitempty" yaml:"isRedirect,omitempty"` EditMessageId string `json:"editMessageId,omitempty" yaml:"editMessageId,omitempty"` }
type Request ¶
type Request struct { Id string `json:"id,omitempty" yaml:"id,omitempty"` ContextId string `json:"contextId,omitempty" yaml:"contextId,omitempty"` IntentId string `json:"intentId,omitempty" yaml:"intentId,omitempty"` Source string `json:"source,omitempty" yaml:"source,omitempty"` Bot User `json:"bot,omitempty" yaml:"bot,omitempty"` Author User `json:"author,omitempty" yaml:"author,omitempty"` ChannelId string `json:"channelId,omitempty" yaml:"channelId,omitempty"` ServerId string `json:"serverId,omitempty" yaml:"serverId,omitempty"` Servers []Server `json:"servers,omitempty" yaml:"servers,omitempty"` Mentions []User `json:"mentions,omitempty" yaml:"mentions,omitempty"` Content string `json:"content,omitempty" yaml:"content,omitempty"` Application Application `json:"application,omitempty" yaml:"application,omitempty"` QueryParams map[string][]string `json:"queryParams,omitempty"` }
type Response ¶
type Response struct { Messages []*Message `json:"messages,omitempty" yaml:"messages,omitempty"` Reactions []*Reaction `json:"reactions,omitempty" yaml:"reactions,omitempty"` Jobs []*Job `json:"jobs,omitempty" yaml:"jobs,omitempty"` }
func StringResponse ¶ added in v0.1.1
type Schedule ¶ added in v0.0.5
type Schedule struct { Minute string `json:"minute,omitempty" yaml:"minute,omitempty"` Hour string `json:"hour,omitempty" yaml:"hour,omitempty"` DayOfMonth string `json:"dayOfMonth,omitempty" yaml:"dayOfMonth,omitempty"` Month string `json:"month,omitempty" yaml:"month,omitempty"` DayOfWeek string `json:"dayOfWeek,omitempty" yaml:"dayOfWeek,omitempty"` Year string `json:"year,omitempty" yaml:"year,omitempty"` }
type SelectMenu ¶ added in v0.3.7
type SelectMenu struct { CustomId string `json:"customId,omitempty" yaml:"customId,omitempty"` Placeholder string `json:"placeholder" yaml:"placeholder,omitempty"` MinValues *int `json:"minValues,omitempty" yaml:"minValues,omitempty"` MaxValues int `json:"maxValues,omitempty" yaml:"maxValues,omitempty"` Options []SelectMenuOption `json:"options" yaml:"options,omitempty"` Disabled bool `json:"disabled" yaml:"disabled,omitempty"` }
type SelectMenuOption ¶ added in v0.3.7
type SelectMenuOption struct { Label string `json:"label,omitempty" yaml:"label,omitempty"` Value string `json:"value" yaml:"value,omitempty"` Description string `json:"description" yaml:"description,omitempty"` Emoji ComponentEmoji `json:"emoji" yaml:"emoji,omitempty"` Default bool `json:"default" yaml:"default,omitempty"` }
type Server ¶
type Server struct { Id string `json:"id,omitempty" yaml:"id,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` OwnerId string `json:"ownerId,omitempty" yaml:"ownerId,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` UserCount int32 `json:"userCount,omitempty" yaml:"userCount,omitempty"` IconUrl string `json:"iconUrl,omitempty" yaml:"iconUrl,omitempty"` SystemChannelId string `json:"systemChannelId,omitempty" yaml:"systemChannelId,omitempty"` }
type TextInput ¶ added in v0.3.7
type TextInput struct { CustomId string `json:"customId" yaml:"customId,omitempty"` Label string `json:"label" yaml:"label,omitempty"` Style uint `json:"style" yaml:"style,omitempty"` Placeholder string `json:"placeholder,omitempty" yaml:"placeholder,omitempty"` Value string `json:"value,omitempty" yaml:"value,omitempty"` Required bool `json:"required,omitempty" yaml:"required,omitempty"` MinLength int `json:"minLength,omitempty" yaml:"minLength,omitempty"` MaxLength int `json:"maxLength,omitempty" yaml:"maxLength,omitempty"` }
Click to show internal directories.
Click to hide internal directories.