Documentation ¶
Index ¶
- Constants
- func IsRetryable(ctx context.Context, resp *http.Response) bool
- func RestoreCustomID(ctx context.Context, redisApp redis.Client, prefix, customID string, ...) (url.Values, error)
- func SaveCustomID(ctx context.Context, redisApp redis.Client, prefix string, values url.Values) (string, error)
- type AllowedMentions
- type Attachment
- type Author
- type Channel
- type Command
- type CommandOption
- type Component
- type Config
- type Embed
- type Field
- type Guild
- type Image
- type InteractionCallbackType
- type InteractionDataResponse
- type InteractionRequest
- type InteractionResponse
- func AsyncResponse(replace, ephemeral bool) InteractionResponse
- func NewEphemeral(replace bool, content string) InteractionResponse
- func NewError(replace bool, err error) InteractionResponse
- func NewReplace(content string) InteractionResponse
- func NewResponse(iType InteractionCallbackType, content string) InteractionResponse
- func (i InteractionResponse) AddAttachment(filename, filepath string, size int64) InteractionResponse
- func (i InteractionResponse) AddComponent(component Component) InteractionResponse
- func (i InteractionResponse) AddEmbed(embed Embed) InteractionResponse
- func (i InteractionResponse) Ephemeral() InteractionResponse
- type Member
- type Message
- type OnMessage
- type Service
- func (s Service) ConfigureCommands(ctx context.Context, commands map[string]Command) error
- func (s Service) DeleteMessage(ctx context.Context, req request.Request, message Message) error
- func (s Service) Messages(ctx context.Context, req request.Request, channelID string, ...) error
- func (s Service) NewServeMux() *http.ServeMux
- func (s Service) SigninClient(ctx context.Context, scopes ...string) (request.Request, error)
- type User
Constants ¶
View Source
const ( ApplicationCommandInteraction interactionType = 2 MessageComponentInteraction interactionType = 3 )
View Source
const ( PrimaryButton buttonStyle = 1 SecondaryButton buttonStyle = 2 DangerButton buttonStyle = 4 )
View Source
const (
ActionRowType componentType = 1
)
View Source
const (
EphemeralMessage int = 1 << 6
)
Variables ¶
This section is empty.
Functions ¶
func RestoreCustomID ¶ added in v0.2.1
Types ¶
type AllowedMentions ¶
type AllowedMentions struct {
Parse []string `json:"parse"`
}
type Attachment ¶
type Command ¶
type Command struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Options []CommandOption `json:"options,omitempty"` Guilds []string `json:"-"` }
type CommandOption ¶
type Component ¶
type Config ¶
type Embed ¶
type Embed struct { Thumbnail *Image `json:"thumbnail,omitempty"` Image *Image `json:"image,omitempty"` Author *Author `json:"author,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` URL string `json:"url,omitempty"` Fields []Field `json:"fields,omitempty"` Color int `json:"color,omitempty"` }
type Field ¶
type InteractionCallbackType ¶
type InteractionCallbackType uint
const ( ChannelMessageWithSource InteractionCallbackType = 4 DeferredChannelMessageWithSource InteractionCallbackType = 5 DeferredUpdateMessage InteractionCallbackType = 6 UpdateMessageCallback InteractionCallbackType = 7 )
type InteractionDataResponse ¶
type InteractionDataResponse struct { Content string `json:"content,omitempty"` AllowedMentions AllowedMentions `json:"allowed_mentions"` Embeds []Embed `json:"embeds"` // no `omitempty` to pass empty array when cleared Components []Component `json:"components"` // no `omitempty` to pass empty array when cleared Attachments []Attachment `json:"attachments"` // no `omitempty` to pass empty array when cleared Flags int `json:"flags"` }
func NewDataResponse ¶ added in v0.0.3
func NewDataResponse(content string) InteractionDataResponse
NewDataResponse create a data response
func (InteractionDataResponse) AddEmbed ¶ added in v0.0.3
func (d InteractionDataResponse) AddEmbed(embed Embed) InteractionDataResponse
AddEmbed add given embed to response
type InteractionRequest ¶
type InteractionRequest struct { Member Member `json:"member"` ID string `json:"id"` GuildID string `json:"guild_id"` Token string `json:"token"` ApplicationID string `json:"application_id"` Message struct { Interaction struct { Name string `json:"name"` } `json:"interaction"` } `json:"message"` Data struct { Name string `json:"name"` CustomID string `json:"custom_id"` Options []CommandOption `json:"options"` } `json:"data"` Type interactionType `json:"type"` }
type InteractionResponse ¶
type InteractionResponse struct { Data InteractionDataResponse `json:"data,omitempty"` Type InteractionCallbackType `json:"type,omitempty"` }
func AsyncResponse ¶
func AsyncResponse(replace, ephemeral bool) InteractionResponse
func NewEphemeral ¶
func NewEphemeral(replace bool, content string) InteractionResponse
func NewError ¶
func NewError(replace bool, err error) InteractionResponse
func NewReplace ¶ added in v0.5.0
func NewReplace(content string) InteractionResponse
func NewResponse ¶
func NewResponse(iType InteractionCallbackType, content string) InteractionResponse
func (InteractionResponse) AddAttachment ¶
func (i InteractionResponse) AddAttachment(filename, filepath string, size int64) InteractionResponse
func (InteractionResponse) AddComponent ¶ added in v0.0.3
func (i InteractionResponse) AddComponent(component Component) InteractionResponse
func (InteractionResponse) AddEmbed ¶
func (i InteractionResponse) AddEmbed(embed Embed) InteractionResponse
func (InteractionResponse) Ephemeral ¶
func (i InteractionResponse) Ephemeral() InteractionResponse
type Message ¶ added in v0.6.0
type OnMessage ¶
type OnMessage func(context.Context, InteractionRequest) (InteractionResponse, bool, func(context.Context) InteractionResponse)
type Service ¶ added in v0.3.2
type Service struct {
// contains filtered or unexported fields
}
func (Service) ConfigureCommands ¶ added in v0.3.2
func (Service) DeleteMessage ¶ added in v0.6.0
func (Service) NewServeMux ¶ added in v0.4.7
Source Files ¶
Click to show internal directories.
Click to hide internal directories.