aboutsummaryrefslogtreecommitdiff
path: root/src/model/error.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-06-26 21:50:16 -0700
committerZeyla Hellyer <[email protected]>2017-06-26 21:50:16 -0700
commitaf1061b5e82ed1bf4e71ff3146cb98bc6cbb678c (patch)
tree6a33be2c9cea182a04b82273244c097bbfff33c9 /src/model/error.rs
parentFix ModelError doctest (diff)
downloadserenity-af1061b5e82ed1bf4e71ff3146cb98bc6cbb678c.tar.xz
serenity-af1061b5e82ed1bf4e71ff3146cb98bc6cbb678c.zip
Prevent Direct Messaging other bot users
The API no longer allows bot users to Direct Message other bot users, so pre-emptively check that the recipient is not a bot. If it is, return a `ModelError::MessagingBot`.
Diffstat (limited to 'src/model/error.rs')
-rw-r--r--src/model/error.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/model/error.rs b/src/model/error.rs
index a54b1ed..4126ac3 100644
--- a/src/model/error.rs
+++ b/src/model/error.rs
@@ -101,6 +101,9 @@ pub enum Error {
///
/// [`Message`]: ../model/struct.Message.html
MessageTooLong(u64),
+ /// Indicates that the current user is attempting to Direct Message another
+ /// bot user, which is disallowed by the API.
+ MessagingBot,
}
impl Display for Error {