Documentation
¶
Index ¶
- Constants
- func CreateFollowupMessage(appId SnowFlake, authToken string, iaToken string, data WebhookMessagePostData)
- func CreateInteractionResponse(appId SnowFlake, authToken string, iaId SnowFlake, iaToken string, ...)
- func DeleteApplicationCommand(appId SnowFlake, authToken string, cmdId SnowFlake, guildId *SnowFlake)
- func DeleteOriginalInteractionResponse(appId SnowFlake, authToken string, iaToken string, msgId *SnowFlake)
- func SignatureVerify(r *http.Request, key ed25519.PublicKey) bool
- type AllowedMention
- type ApplicationCommand
- func BulkOverwriteApplicationCommands(appId SnowFlake, authToken string, guildId *SnowFlake, ...) []ApplicationCommand
- func CreateApplicationCommands(appId SnowFlake, authToken string, guildId *SnowFlake, ...) ApplicationCommand
- func EditApplicationCommand(appId SnowFlake, authToken string, cmdId SnowFlake, guildId *SnowFlake, ...) ApplicationCommand
- func GetApplicationCommand(appId SnowFlake, authToken string, cmdId SnowFlake, guildId *SnowFlake) ApplicationCommand
- func GetApplicationCommands(appId SnowFlake, authToken string, guildId *SnowFlake) []ApplicationCommand
- type ApplicationCommandInteractionData
- type ApplicationCommandInteractionDataOption
- type ApplicationCommandInteractionDataResolved
- type ApplicationCommandOption
- type ApplicationCommandOptionChoice
- type ApplicationCommandOptionType
- type ApplicationCommandPatchData
- type ApplicationCommandPermissions
- type ApplicationCommandPermissonType
- type ApplicationCommandPostData
- type GCFInteractionFunction
- type GCFInteractionHandler
- type GuildApplicationCommandPermissions
- type Interaction
- type InteractionApplicationCommandCallbackData
- type InteractionCallbackType
- type InteractionReponse
- type InteractionServer
- type InteractionType
- type Message
- type MessageInteraction
- type OptionType
- type SnowFlake
- type StandaloneInteractionHandler
- type WebhookMessagePatchData
- type WebhookMessagePostData
Constants ¶
View Source
const ( AcptRole = 1 AcptUser = 2 )
Acpt: ApplicationCommandPermissonType
View Source
const (
BaseAPIUrl = "https://discord.com/api/v8/"
)
Variables ¶
This section is empty.
Functions ¶
func CreateFollowupMessage ¶
func CreateFollowupMessage(appId SnowFlake, authToken string, iaToken string, data WebhookMessagePostData)
func CreateInteractionResponse ¶
func CreateInteractionResponse(appId SnowFlake, authToken string, iaId SnowFlake, iaToken string, res InteractionReponse)
Types ¶
type AllowedMention ¶
type AllowedMention interface{} // FIXME: これInterfaceなんだけどどうしよう
type ApplicationCommand ¶
type ApplicationCommand struct {
Id SnowFlake `json:"id"`
ApplicationId SnowFlake `json:"application_id"`
Name string `json:"name"`
Description string `json:"description"`
Options *[]ApplicationCommandOption `json:"options,omitempty"`
DefaultPermisson *bool `json:"default_permission,omitempty"` // default: true
}
func BulkOverwriteApplicationCommands ¶
func BulkOverwriteApplicationCommands(appId SnowFlake, authToken string, guildId *SnowFlake, data []ApplicationCommandPostData) []ApplicationCommand
func CreateApplicationCommands ¶
func CreateApplicationCommands(appId SnowFlake, authToken string, guildId *SnowFlake, data ApplicationCommandPostData) ApplicationCommand
func EditApplicationCommand ¶
func EditApplicationCommand(appId SnowFlake, authToken string, cmdId SnowFlake, guildId *SnowFlake, data ApplicationCommandPatchData) ApplicationCommand
func GetApplicationCommand ¶
func GetApplicationCommand(appId SnowFlake, authToken string, cmdId SnowFlake, guildId *SnowFlake) ApplicationCommand
func GetApplicationCommands ¶
func GetApplicationCommands(appId SnowFlake, authToken string, guildId *SnowFlake) []ApplicationCommand
type ApplicationCommandInteractionData ¶
type ApplicationCommandInteractionData struct {
Id SnowFlake `json:"id"`
Name string `json:"name"`
Resolved *ApplicationCommandInteractionDataResolved `json:"resolved,omitempty"`
Options *[]ApplicationCommandInteractionDataOption `json:"options,omitempty"`
CustomId string `json:"custom_id"`
ComponentType int `json:"component_type"`
}
type ApplicationCommandInteractionDataOption ¶
type ApplicationCommandInteractionDataOption struct {
Name string `json:"name"`
Type ApplicationCommandOptionType `json:"type"`
Value *OptionType `json:"value,omitempty"`
Options *[]ApplicationCommandInteractionDataOption `json:"options,omitempty"`
}
type ApplicationCommandInteractionDataResolved ¶
type ApplicationCommandInteractionDataResolved struct {
}
type ApplicationCommandOption ¶
type ApplicationCommandOption struct {
Type ApplicationCommandOptionType `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
Required *bool `json:"required,omitempty"`
Choices *[]ApplicationCommandOptionChoice `json:"choices,omitempty"`
Options *[]ApplicationCommandOption `json:"options,omitempty"`
}
type ApplicationCommandOptionType ¶
type ApplicationCommandOptionType int
const ( AcotSubCommand ApplicationCommandOptionType = 1 AcotSubCommandGroup ApplicationCommandOptionType = 2 AcotString ApplicationCommandOptionType = 3 AcotInteger ApplicationCommandOptionType = 4 AcotBoolean ApplicationCommandOptionType = 5 AcotUser ApplicationCommandOptionType = 6 AcotChannel ApplicationCommandOptionType = 7 AcotRole ApplicationCommandOptionType = 8 AcotMentionable ApplicationCommandOptionType = 9 )
Acot: ApplicationCommandOptionType
type ApplicationCommandPatchData ¶
type ApplicationCommandPatchData struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Options []ApplicationCommandOption `json:"options,omitempty"`
DefaultPermisson bool `json:"default_permisson,omitempty"`
}
FIXME: 内容は同じだけどtagだけ違うので微妙なところではある "...PostData"との統合を検討.
type ApplicationCommandPermissions ¶
type ApplicationCommandPermissions struct {
Id SnowFlake `json:"id"`
Type ApplicationCommandPermissonType `json:"type"`
Permisson bool `json:"permisson"`
}
type ApplicationCommandPermissonType ¶
type ApplicationCommandPermissonType int
type ApplicationCommandPostData ¶
type ApplicationCommandPostData struct {
Name string `json:"name"`
Description string `json:"description"`
Options []ApplicationCommandOption `json:"options,omitempty"`
DefaultPermisson bool `json:"default_permisson,omitempty"`
}
type GCFInteractionFunction ¶
type GCFInteractionFunction func(http.ResponseWriter, *http.Request)
func CreateInteractionHandler ¶
func CreateInteractionHandler(hexEncodedKey string, h GCFInteractionHandler) GCFInteractionFunction
type GCFInteractionHandler ¶
type GCFInteractionHandler func(Interaction) InteractionReponse
type GuildApplicationCommandPermissions ¶
type GuildApplicationCommandPermissions struct {
Id SnowFlake `json:"id"`
ApplicationId SnowFlake `json:"application_id"`
GuiidId SnowFlake `json:"guild_id"`
Permissons []ApplicationCommandPermissions `json:"permissons"`
}
type Interaction ¶
type Interaction struct {
Id SnowFlake `json:"id"`
ApplicationId SnowFlake `json:"application_id"`
Type InteractionType `json:"type"`
Data *ApplicationCommandInteractionData `json:"data,omitempty"`
GuildId *SnowFlake `json:"guild_id"`
ChannelId *SnowFlake `json:"channel_id"`
// Member *Member `json:"member,omitempty"`
// User *User `json:"user,omitempty"`
Token string `json:"token"`
Version int `json:"version"`
}
type InteractionApplicationCommandCallbackData ¶
type InteractionApplicationCommandCallbackData struct {
Tts bool `json:"tts"`
Content *string `json:"content,omitempty"`
// Embeds *[]Embed `json:"embeds,omitempty"`
AllowedMentions *AllowedMention `json:"allowed_mentions,omitempty"`
Flags int `json:"flags"` // set 64
}
type InteractionCallbackType ¶
type InteractionCallbackType int
const ( IctPong InteractionCallbackType = 1 IctChannelMessageWithSource InteractionCallbackType = 4 IctDeferredChannelMessageWithSource InteractionCallbackType = 5 IctDeferredUpdateMessage InteractionCallbackType = 6 IctUpdateMessage InteractionCallbackType = 7 )
type InteractionReponse ¶
type InteractionReponse struct {
Type InteractionCallbackType `json:"type"`
Data *InteractionApplicationCommandCallbackData `json:"data,omitempty"`
}
type InteractionServer ¶
type InteractionServer struct {
// contains filtered or unexported fields
}
func NewInteractionServer ¶
func NewInteractionServer() *InteractionServer
func (*InteractionServer) RegisterHandlers ¶
func (s *InteractionServer) RegisterHandlers(hs ...StandaloneInteractionHandler)
type InteractionType ¶
type InteractionType int
const ( ItPing InteractionType = 1 ItApplicationCommand InteractionType = 2 ItMessageComponent InteractionType = 3 )
It: InteractionType
type Message ¶
type Message struct{}
func EditOriginalInteractionResponse ¶
func EditOriginalInteractionResponse(appId SnowFlake, authToken string, iaToken string, msgId *SnowFlake, data WebhookMessagePatchData) Message
FIXME: msgIdを使用すると"Edit Followup Message"なので命名に問題あり
type MessageInteraction ¶
type MessageInteraction struct {
Id SnowFlake `json:"id"`
Type InteractionType `json:"type"`
Name string `json:"name"`
}
type OptionType ¶
type OptionType string // FIXME: この型わかんない
type WebhookMessagePatchData ¶
type WebhookMessagePatchData struct{}
type WebhookMessagePostData ¶
type WebhookMessagePostData struct{}
Click to show internal directories.
Click to hide internal directories.