aboutsummaryrefslogtreecommitdiff
path: root/src/utils/builder/create_embed.rs
diff options
context:
space:
mode:
authorIllia <[email protected]>2016-12-04 15:01:51 +0300
committerAustin Hellyer <[email protected]>2016-12-04 14:49:37 -0800
commit2844ae158f3d8297b17a584ff9a75f1f51116f48 (patch)
treed8d67cab470bc19a5e6a23dd50d840b3c94fbb47 /src/utils/builder/create_embed.rs
parentUse proper comments on inline ratelimit comments (diff)
downloadserenity-2844ae158f3d8297b17a584ff9a75f1f51116f48.tar.xz
serenity-2844ae158f3d8297b17a584ff9a75f1f51116f48.zip
Add documentation for models
Diffstat (limited to 'src/utils/builder/create_embed.rs')
-rw-r--r--src/utils/builder/create_embed.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/utils/builder/create_embed.rs b/src/utils/builder/create_embed.rs
index 369784f..f9b7dcf 100644
--- a/src/utils/builder/create_embed.rs
+++ b/src/utils/builder/create_embed.rs
@@ -67,6 +67,8 @@ impl CreateEmbed {
}
/// Set the description of the embed.
+ ///
+ /// **Note**: This can't be longer than 2048 characters.
pub fn description(mut self, description: &str) -> Self {
self.0.insert("description".to_owned(), Value::String(description.to_owned()));
@@ -79,6 +81,9 @@ impl CreateEmbed {
/// Refer to the documentation for [`CreateEmbedField`] for more
/// information.
///
+ /// **Note**: Maximum amount of characters you can put is 256 in a field
+ /// name and 1024 in a field value and a field is inline by default.
+ ///
/// [`CreateEmbedField`]: struct.CreateEmbedField.html
pub fn field<F>(mut self, f: F) -> Self
where F: FnOnce(CreateEmbedField) -> CreateEmbedField {
@@ -229,17 +234,17 @@ impl Default for CreateEmbedAuthor {
pub struct CreateEmbedField(pub ObjectBuilder);
impl CreateEmbedField {
- /// Set whether the field is inlined.
+ /// Set whether the field is inlined. Set to true by default.
pub fn inline(self, inline: bool) -> Self {
CreateEmbedField(self.0.insert("inline", inline))
}
- /// Set the field's name.
+ /// Set the field's name. It can't be longer than 256 characters.
pub fn name(self, name: &str) -> Self {
CreateEmbedField(self.0.insert("name", name))
}
- /// Set the field's value.
+ /// Set the field's value. It can't be longer than 1024 characters.
pub fn value(self, value: &str) -> Self {
CreateEmbedField(self.0.insert("value", value))
}