diff options
| author | Austin Hellyer <[email protected]> | 2016-11-07 11:43:15 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-07 11:43:15 -0800 |
| commit | a114a55efb5b08f9e5f289203db2dfd4db82852a (patch) | |
| tree | 8522e8eb3e77534ecf5c8e0208746b587eae887b /definitions/structs | |
| parent | Add Attachment::download{,to_directory} (diff) | |
| download | serenity-a114a55efb5b08f9e5f289203db2dfd4db82852a.tar.xz serenity-a114a55efb5b08f9e5f289203db2dfd4db82852a.zip | |
Add webhook support
Diffstat (limited to 'definitions/structs')
| -rw-r--r-- | definitions/structs/embed.yml | 29 | ||||
| -rw-r--r-- | definitions/structs/embed_author.yml | 20 | ||||
| -rw-r--r-- | definitions/structs/embed_field.yml | 17 | ||||
| -rw-r--r-- | definitions/structs/embed_footer.yml | 17 | ||||
| -rw-r--r-- | definitions/structs/embed_image.yml | 20 | ||||
| -rw-r--r-- | definitions/structs/embed_provider.yml | 2 | ||||
| -rw-r--r-- | definitions/structs/embed_thumbnail.yml | 5 | ||||
| -rw-r--r-- | definitions/structs/embed_video.yml | 17 | ||||
| -rw-r--r-- | definitions/structs/webhook.yml | 47 |
9 files changed, 173 insertions, 1 deletions
diff --git a/definitions/structs/embed.yml b/definitions/structs/embed.yml index 423642f..05cc803 100644 --- a/definitions/structs/embed.yml +++ b/definitions/structs/embed.yml @@ -1,21 +1,48 @@ --- name: Embed -description: An embed in a message for a URL +description: An embed in a message, such as for a URL or an attachment. fields: + - name: author + description: Author information about the embed. + type: EmbedAuthor + - name: colour + description: The color code of the embed. + from: color + type: u64 - name: description + description: The description of the embed. This is the long string of text. optional: true type: string + - name: fields + array: true + description: The array of fields of the embed. + type: EmbedField + - name: image + description: The image information of the embed. + type: EmbedImage - name: kind + description: > + The type of the embed. For webhook embeds, this is always `rich`. from: type type: string - name: provider + description: The provider information for the embed. optional: true type: EmbedProvider + - name: timestamp + description: Timestamp of embed content. + type: string - name: url + description: The URL of the embed. type: string - name: thumbnail + description: The thumbnail provided for the embed. optional: true type: EmbedThumbnail - name: title + description: The title of the embed. optional: true type: string + - name: video + description: The embed's video information. + type: EmbedVideo diff --git a/definitions/structs/embed_author.yml b/definitions/structs/embed_author.yml new file mode 100644 index 0000000..41997cc --- /dev/null +++ b/definitions/structs/embed_author.yml @@ -0,0 +1,20 @@ +--- +name: EmbedAuthor +description: > + An author object in an [`Embed`]. + + + [`Embed`]: struct.Embed.html +fields: + - name: icon_url + description: The URL of the author icon. Note this only supports HTTP(s). + type: string + - name: name + description: The name of the author. + type: string + - name: proxy_icon_url + description: A proxied URL of the author icon. + type: string + - name: url + description: The URL of the author. + type: string diff --git a/definitions/structs/embed_field.yml b/definitions/structs/embed_field.yml new file mode 100644 index 0000000..5050936 --- /dev/null +++ b/definitions/structs/embed_field.yml @@ -0,0 +1,17 @@ +--- +name: EmbedField +description: > + A field object in an [`Embed`]. + + + [`Embed`]: struct.Embed.html +fields: + - name: inline + description: Whether or not the field should display as inline. + type: bool + - name: name + description: The name of the field. + type: string + - name: value + description: The value of the field. + type: string diff --git a/definitions/structs/embed_footer.yml b/definitions/structs/embed_footer.yml new file mode 100644 index 0000000..d840693 --- /dev/null +++ b/definitions/structs/embed_footer.yml @@ -0,0 +1,17 @@ +--- +name: EmbedFooter +description: > + Footer information about an [`Embed`]. + + + [`Embed`]: struct.Embed.html +fields: + - name: icon_url + description: The URL of the footer icon. Note this only supports HTTP(s). + type: string + - name: proxy_icon_url + description: A proxied URL of the footer icon. + type: string + - name: text + description: The associated text with the footer. + type: string diff --git a/definitions/structs/embed_image.yml b/definitions/structs/embed_image.yml new file mode 100644 index 0000000..19c406c --- /dev/null +++ b/definitions/structs/embed_image.yml @@ -0,0 +1,20 @@ +--- +name: EmbedImage +description: > + An image object in an [`Embed`]. + + + [`Embed`]: struct.Embed.html +fields: + - name: height + description: The height of the image. + type: u64 + - name: proxy_url + description: A proxied URL of the image. + type: string + - name: url + description: Source URL of the image. Note this only supports HTTP(s). + type: string + - name: width + description: The width of the image. + type: u64 diff --git a/definitions/structs/embed_provider.yml b/definitions/structs/embed_provider.yml index 7ce6fd2..754be37 100644 --- a/definitions/structs/embed_provider.yml +++ b/definitions/structs/embed_provider.yml @@ -3,7 +3,9 @@ name: EmbedProvider description: The provider of an embed fields: - name: name + description: The name of the provider. type: string - name: url + description: The URL of the provider. optional: true type: string diff --git a/definitions/structs/embed_thumbnail.yml b/definitions/structs/embed_thumbnail.yml index 932ae18..84597e4 100644 --- a/definitions/structs/embed_thumbnail.yml +++ b/definitions/structs/embed_thumbnail.yml @@ -3,10 +3,15 @@ name: EmbedThumbnail description: The dimensions and URL of an embed thumbnail fields: - name: height + description: The height of the thumbnail in pixels. type: u64 - name: proxy_url + description: A proxied URL of the thumbnail. type: string - name: url + description: > + The source URL of the thumbnail. Note this only supports HTTP(s). type: string - name: width + description: The width of the thumbnail in pixels. type: u64 diff --git a/definitions/structs/embed_video.yml b/definitions/structs/embed_video.yml new file mode 100644 index 0000000..7296c85 --- /dev/null +++ b/definitions/structs/embed_video.yml @@ -0,0 +1,17 @@ +--- +name: EmbedVideo +description: > + A video information object in an [`Embed`]. + + + [`Embed`]: struct.Embed.html +fields: + - name: height + description: The height of the video. + type: u64 + - name: url + description: The source URL of the video. + type: string + - name: width + description: The width of the video. + type: u64 diff --git a/definitions/structs/webhook.yml b/definitions/structs/webhook.yml new file mode 100644 index 0000000..a2f3c4c --- /dev/null +++ b/definitions/structs/webhook.yml @@ -0,0 +1,47 @@ +--- +name: Webhook +description: > + A representation of a webhook, which is a low-effort way to post messages to + channels. They do not necessarily require a bot user or authentication to use. +fields: + - name: id + description: The Id of the webhook. + type: WebhookId + - name: avatar + description: > + The default avatar of the webhook. Note that this can be modified with a + payload. + optional: true + type: string + - name: channel_id + description: > + The Id of the [channel][`PublicChannel`] that owns the webhook. + + + [`PublicChannel`]: struct.PublicChannel.html + type: ChannelId + - name: guild_id + description: > + The Id of the [`Guild`] that owns the webhook. + + + [`Guild`]: struct.Guild.html + optional: true + type: GuildId + - name: name + description: > + The default name of the webhook. Note that this can be modified in a + payload. + optional: true + type: string + - name: token + description: The webhook's secure token. + type: string + - name: user + description: > + The user that created the webhook. + + + **Note**: This is not returned when getting a webhook by its token. + optional: true + type: User |