aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel/mod.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-01-18 10:36:50 -0800
committerZeyla Hellyer <[email protected]>2018-01-18 10:36:50 -0800
commitedb76627d3fe292688b3c072c3d3f40db52e8aef (patch)
treeb37affd2a928d1845bdebe23a5456f7e3e878fd0 /src/model/channel/mod.rs
parentUpdate readme example (diff)
downloadserenity-edb76627d3fe292688b3c072c3d3f40db52e8aef.tar.xz
serenity-edb76627d3fe292688b3c072c3d3f40db52e8aef.zip
Add an `EditMessage` builder
When editing messages, not all fields are applicable. Attachments, TTS, and reactions are not applicable. To help with this distinction, separate message editing into a different builder.
Diffstat (limited to 'src/model/channel/mod.rs')
-rw-r--r--src/model/channel/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs
index 1a6bcd5..eadc7bb 100644
--- a/src/model/channel/mod.rs
+++ b/src/model/channel/mod.rs
@@ -28,7 +28,7 @@ use serde_json;
use super::utils::deserialize_u64;
#[cfg(feature = "model")]
-use builder::{CreateMessage, GetMessages};
+use builder::{CreateMessage, EditMessage, GetMessages};
#[cfg(feature = "model")]
use http::AttachmentType;
#[cfg(feature = "model")]
@@ -277,7 +277,7 @@ impl Channel {
///
/// Message editing preserves all unchanged message data.
///
- /// Refer to the documentation for [`CreateMessage`] for more information
+ /// Refer to the documentation for [`EditMessage`] for more information
/// regarding message restrictions and requirements.
///
/// **Note**: Requires that the current user be the author of the message.
@@ -289,14 +289,14 @@ impl Channel {
/// over the limit.
///
/// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [`CreateMessage`]: ../builder/struct.CreateMessage.html
+ /// [`EditMessage`]: ../builder/struct.EditMessage.html
/// [`Message`]: struct.Message.html
- /// [`the limit`]: ../builder/struct.CreateMessage.html#method.content
+ /// [`the limit`]: ../builder/struct.EditMessage.html#method.content
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
pub fn edit_message<F, M>(&self, message_id: M, f: F) -> Result<Message>
- where F: FnOnce(CreateMessage) -> CreateMessage, M: Into<MessageId> {
+ where F: FnOnce(EditMessage) -> EditMessage, M: Into<MessageId> {
self.id().edit_message(message_id, f)
}