Documentation ¶
Index ¶
- Constants
- type DiscordAllowedMention
- type DiscordApplicationCommand
- type DiscordApplicationCommandInteractionDataOption
- type DiscordApplicationCommandInteractionDataResolved
- type DiscordApplicationCommandOption
- type DiscordApplicationCommandOptionChoice
- type DiscordApplicationCommandOptionType
- type DiscordAttachment
- type DiscordAuthor
- type DiscordEditWebhookMessage
- type DiscordEmbed
- type DiscordEmbedField
- type DiscordFooter
- type DiscordImage
- type DiscordInteraction
- type DiscordInteractionApplicationCommandCallbackData
- type DiscordInteractionCallbackType
- type DiscordInteractionResponse
- type DiscordInteractionType
- type DiscordMember
- type DiscordOptionType
- type DiscordProvider
Constants ¶
View Source
const DiscordAPIv8URL = "discord.com/api/v8"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscordAllowedMention ¶
type DiscordAllowedMention struct { // of allowed mention types An array of allowed mention types to parse from the content. Parse []string `json:"parse,omitempty"` // of snowflakes Array of role_ids to mention (Max size of 100) Roles []string `json:"roles,omitempty"` // of snowflakes Array of user_ids to mention (Max size of 100) Users []string `json:"users,omitempty"` // For replies, whether to mention the author of the message being replied to (default false) RepliedUser bool `json:"replied_user,omitempty"` }
type DiscordApplicationCommand ¶
type DiscordApplicationCommand struct { // snowflake unique id of the command ID string `json:"id,omitempty"` // snowflake unique id of the parent application ApplicationID string `json:"application_id,omitempty"` // 1-32 lowercase character name matching ^[\w-]{1,32}$ Name string `json:"name"` //1-100 character description Description string `json:"description"` Options []*DiscordApplicationCommandOption `json:"options,omitempty"` DefaultPermission bool `json:"default_permission,omitempty"` }
type DiscordApplicationCommandInteractionDataOption ¶
type DiscordApplicationCommandInteractionDataOption struct { // the name of the parameter Name string `json:"name"` // value of ApplicationCommandOptionType Type DiscordApplicationCommandOptionType `json:"type"` // the value of the pair Value DiscordOptionType `json:"value"` // of ApplicationCommandInteractionDataOption present if this option is a group or subcommand Options []DiscordApplicationCommandInteractionDataOption `json:"options,omitempty"` }
DiscordApplicationCommandInteractionDataOption
type DiscordApplicationCommandInteractionDataResolved ¶
type DiscordApplicationCommandInteractionDataResolved struct { // ID: User the IDs and User objects Users string `json:"users"` // ID: Member the IDs and partial Member objects Members string `json:"members"` // ID: Role the IDs and Role objects Roles string `json:"roles"` // ID: Channel the IDs and partial Channel objects Channels string `json:"channels"` }
type DiscordApplicationCommandOption ¶
type DiscordApplicationCommandOption struct { // value of ApplicationCommandOptionType Type DiscordApplicationCommandOptionType `json:"type"` // 1-32 lowercase character name matching ^[\w-]{1,32}$ Name string `json:"name"` // 1-100 character description Description string `json:"description"` // boolean if the parameter is required or optional--default false Required bool `json:"required"` // array of ApplicationCommandOptionChoice choices for string and int types for the user to pick from Choices []*DiscordApplicationCommandOptionChoice `json:"choices,omitempty"` // array of ApplicationCommandOption if the option is a subcommand or subcommand group type, this nested options will be the parameters Options []*DiscordApplicationCommandOption `json:"options,omitempty"` }
type DiscordApplicationCommandOptionType ¶
type DiscordApplicationCommandOptionType int
const ( DiscordApplicationCommandOptionTypeSubCommand DiscordApplicationCommandOptionType = 1 DiscordApplicationCommandOptionTypeSubCommandGroup DiscordApplicationCommandOptionType = 2 DiscordApplicationCommandOptionTypeString DiscordApplicationCommandOptionType = 3 DiscordApplicationCommandOptionTypeInteger DiscordApplicationCommandOptionType = 4 DiscordApplicationCommandOptionTypeBoolean DiscordApplicationCommandOptionType = 5 DiscordApplicationCommandOptionTypeUser DiscordApplicationCommandOptionType = 6 DiscordApplicationCommandOptionTypeChannel DiscordApplicationCommandOptionType = 7 DiscordApplicationCommandOptionTypeRole DiscordApplicationCommandOptionType = 8 DiscordApplicationCommandOptionTypeMentionable DiscordApplicationCommandOptionType = 9 )
type DiscordAttachment ¶
type DiscordAttachment struct { // attachment id ID string `json:"id"` // name of file attached Filename string `json:"filename"` // the attachment's media type ContentType string `json:"content_type,omitempty"` // size of file in bytes Size int `json:"size"` // source url of file URL string `json:"url"` // a proxied url of file ProxyURL string `json:"proxy_url"` // height of file (if image) Height int `json:"height,omitempty"` // width of file (if image) Width int `json:"width,omitempty"` }
type DiscordAuthor ¶
type DiscordEditWebhookMessage ¶
type DiscordEditWebhookMessage struct { // the message contents (up to 2000 characters) Content string `json:"content,omitempty"` // of up to 10 embed objects embedded rich content Embeds []*DiscordEmbed `json:"embeds,omitempty"` // contents the contents of the file being sent/edited File string `json:"file,omitempty"` // JSON encoded body of non-file params (multipart/form-data only) PayloadJSON string `json:"payload_json,omitempty"` // mention object allowed mentions for the message AllowedMentions *DiscordAllowedMention `json:"allowed_mentions,omitempty"` // of attachment objects attached files to keep Attachments *DiscordAttachment `json:"attachments,omitempty"` }
DiscordEditWebhookMessage is the type represented in https://discord.com/developers/docs/resources/webhook#edit-webhook-message
type DiscordEmbed ¶
type DiscordEmbed struct { // title of embed Title string `json:"title"` // type of embed (always "rich" for webhook embeds) Type string `json:"type"` // description of embed Description string `json:"description"` // url of embed URL string `json:"url"` // timestamp timestamp of embed content Timestamp time.Time `json:"timestamp"` // color code of the embed Color int `json:"color"` Footer *DiscordFooter `json:"footer,omitempty"` // image object image information Image *DiscordImage `json:"image,omitempty"` // thumbnail object thumbnail information Thumbnail *DiscordImage `json:"thumbnail,omitempty"` // video object video information Video *DiscordImage `json:"video,omitempty"` // provider object provider information Provider *DiscordProvider `json:"provider,omitempty"` // author object author information Author *DiscordAuthor `json:"author,omitempty"` // of embed field objects fields information Fields []DiscordEmbedField `json:"fields,omitempty"` }
type DiscordEmbedField ¶
type DiscordFooter ¶
type DiscordImage ¶
type DiscordInteraction ¶
type DiscordInteraction struct { // id of the interaction ID string `json:"id"` // id of the application this interaction is for ApplicationID string `json:"application_id"` // the type of interaction Type DiscordInteractionType `json:"type"` // the command data payload Data struct { // the ID of the invoked command ID string `json:"id"` // the name of the invoked command Name string `json:"name"` // converted users + roles + channels Resolved *DiscordApplicationCommandInteractionDataResolved `json:"resolved,omitempty"` // of ApplicationCommandInteractionDataOption the params + values from the user Options []*DiscordApplicationCommandInteractionDataOption `json:"options,omitempty"` } `json:"data"` // the guild it was sent from GuildID string `json:"guild_id"` // the channel it was sent from ChannelID string `json:"channel_id"` // member object guild member data for the invoking user, including permissions Member *DiscordMember `json:"member,omitempty"` // object user object for the invoking user, if invoked in a DM User discordgo.User `json:"user"` // a continuation token for responding to the interaction Token string `json:"token"` // read-only property, always 1 Version int `json:"version"` }
type DiscordInteractionApplicationCommandCallbackData ¶
type DiscordInteractionApplicationCommandCallbackData struct { // is the response TTS TTS bool `json:"tts"` // message content Content string `json:"content"` // of embeds supports up to 10 embeds Embeds []*DiscordEmbed `json:"embeds,omitempty"` // allowed mentions object AllowedMentions *DiscordAllowedMention `json:"allowed_mentions,omitempty"` // set to 64 to make your response ephemeral Flags int `json:"flags"` }
type DiscordInteractionCallbackType ¶
type DiscordInteractionCallbackType int
const ( // DiscordInteractionCallbackTypePong ACK a Ping DiscordInteractionCallbackTypePong DiscordInteractionCallbackType = 1 // DiscordInteractionCallbackTypeChannelMessageWithSource respond to an interaction with a message DiscordInteractionCallbackTypeChannelMessageWithSource DiscordInteractionCallbackType = 4 // DiscordInteractionCallbackTypeDeferredChannelMessageWithSource ACK an interaction and edit a response later, the user sees a loading state DiscordInteractionCallbackTypeDeferredChannelMessageWithSource DiscordInteractionCallbackType = 5 )
type DiscordInteractionResponse ¶
type DiscordInteractionResponse struct { // the type of response Type DiscordInteractionCallbackType `json:"type"` // an optional response message Data DiscordInteractionApplicationCommandCallbackData `json:"data"` }
type DiscordInteractionType ¶
type DiscordInteractionType int
const ( DiscordInteractionTypePing DiscordInteractionType = 1 DiscordInteractionTypeApplicationCommand DiscordInteractionType = 2 )
type DiscordMember ¶
type DiscordMember struct { // object the user this guild member represents User discordgo.User `json:"user"` // this users guild nickname Nick string `json:"nick"` // of snowflakes array of role object ids Roles []string `json:"roles"` // timestamp when the user joined the guild JoinedAt time.Time `json:"joined_at"` // timestamp when the user started boosting the guild PremiumSince time.Time `json:"premium_since"` // whether the user is deafened in voice channels Deaf bool `json:"deaf"` // whether the user is muted in voice channels Mute bool `json:"mute"` // whether the user has not yet passed the guild's Membership Screening requirements Pending bool `json:"pending"` // total permissions of the member in the channel, including overrides, returned when in the interaction object Permissions string `json:"permissions"` }
type DiscordOptionType ¶
func (DiscordOptionType) MarshalJSON ¶
func (d DiscordOptionType) MarshalJSON() ([]byte, error)
func (*DiscordOptionType) UnmarshalJSON ¶
func (d *DiscordOptionType) UnmarshalJSON(bytes []byte) error
type DiscordProvider ¶
Source Files ¶
- allowed_mention.go
- application_command.go
- application_command_interaction_data_option.go
- application_command_interaction_data_resolved.go
- application_command_option.go
- application_command_option_choice.go
- application_command_option_type.go
- attachment.go
- author.go
- discord_api_url.go
- edit_webhook_message.go
- embed.go
- embed_field.go
- footer.go
- image.go
- interaction.go
- interaction_application_command_callback_data.go
- interaction_callback_type.go
- interaction_response.go
- interaction_type.go
- member.go
- option_type.go
- provider.go
Click to show internal directories.
Click to hide internal directories.