From af1061b5e82ed1bf4e71ff3146cb98bc6cbb678c Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Mon, 26 Jun 2017 21:50:16 -0700 Subject: 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`. --- src/model/error.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/model/error.rs') 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 { -- cgit v1.2.3