aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2018-03-20 20:07:40 +0100
committeracdenisSK <[email protected]>2018-03-20 20:07:40 +0100
commit77c399ba7b3bff0cf3180df5edad5d6ff6dcb10d (patch)
tree229c0a9f3236d4630e225ecbb57b7416b44a7ac2 /src
parentAdd no_run to doctests that initialize a Client (#293) (diff)
downloadserenity-77c399ba7b3bff0cf3180df5edad5d6ff6dcb10d.tar.xz
serenity-77c399ba7b3bff0cf3180df5edad5d6ff6dcb10d.zip
Fix Create(Embed/Message) to be consistent
Diffstat (limited to 'src')
-rw-r--r--src/builder/create_embed.rs18
-rw-r--r--src/builder/create_message.rs8
2 files changed, 13 insertions, 13 deletions
diff --git a/src/builder/create_embed.rs b/src/builder/create_embed.rs
index bf312c6..de2031c 100644
--- a/src/builder/create_embed.rs
+++ b/src/builder/create_embed.rs
@@ -54,7 +54,7 @@ impl CreateEmbed {
self.0.insert("author", Value::Object(map));
- CreateEmbed(self.0)
+ self
}
/// Set the colour of the left-hand side of the embed.
@@ -74,7 +74,7 @@ impl CreateEmbed {
Value::Number(Number::from(u64::from(colour.into().0))),
);
- CreateEmbed(self.0)
+ self
}
/// Set the colour of the left-hand side of the embed.
@@ -92,7 +92,7 @@ impl CreateEmbed {
self.0
.insert("color", Value::Number(Number::from(colour)));
- CreateEmbed(self.0)
+ self
}
/// Set the description of the embed.
@@ -104,7 +104,7 @@ impl CreateEmbed {
Value::String(description.to_string()),
);
- CreateEmbed(self.0)
+ self
}
/// Set a field. Note that this will not overwrite other fields, and will
@@ -161,7 +161,7 @@ impl CreateEmbed {
self.0.insert("footer", Value::Object(map));
- CreateEmbed(self.0)
+ self
}
fn url_object(mut self, name: &'static str, url: &str) -> Self {
@@ -171,7 +171,7 @@ impl CreateEmbed {
self.0.insert(name, obj);
- CreateEmbed(self.0)
+ self
}
/// Set the image associated with the embed. This only supports HTTP(S).
@@ -276,7 +276,7 @@ impl CreateEmbed {
self.0
.insert("timestamp", Value::String(timestamp.into().ts));
- CreateEmbed(self.0)
+ self
}
/// Set the title of the embed.
@@ -284,7 +284,7 @@ impl CreateEmbed {
self.0
.insert("title", Value::String(title.to_string()));
- CreateEmbed(self.0)
+ self
}
/// Set the URL to direct to when clicking on the title.
@@ -292,7 +292,7 @@ impl CreateEmbed {
self.0
.insert("url", Value::String(url.as_ref().to_string()));
- CreateEmbed(self.0)
+ self
}
/// Same as calling [`image`] with "attachment://filename.(jpg, png)".
diff --git a/src/builder/create_message.rs b/src/builder/create_message.rs
index 07242f0..df6f4d5 100644
--- a/src/builder/create_message.rs
+++ b/src/builder/create_message.rs
@@ -49,7 +49,7 @@ impl CreateMessage {
pub fn content<D: Display>(mut self, content: D) -> Self {
self.0.insert("content", Value::String(content.to_string()));
- CreateMessage(self.0, self.1)
+ self
}
/// Set an embed for the message.
@@ -60,7 +60,7 @@ impl CreateMessage {
self.0.insert("embed", embed);
- CreateMessage(self.0, self.1)
+ self
}
/// Set whether the message is text-to-speech.
@@ -71,14 +71,14 @@ impl CreateMessage {
pub fn tts(mut self, tts: bool) -> Self {
self.0.insert("tts", Value::Bool(tts));
- CreateMessage(self.0, self.1)
+ self
}
/// Adds a list of reactions to create after the message's sent.
pub fn reactions<R: Into<ReactionType>, It: IntoIterator<Item=R>>(mut self, reactions: It) -> Self {
self.1 = Some(reactions.into_iter().map(|r| r.into()).collect());
- CreateMessage(self.0, self.1)
+ self
}
}