diff options
| author | Zeyla Hellyer <[email protected]> | 2017-06-26 21:50:16 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-06-26 21:50:16 -0700 |
| commit | af1061b5e82ed1bf4e71ff3146cb98bc6cbb678c (patch) | |
| tree | 6a33be2c9cea182a04b82273244c097bbfff33c9 /src/model/error.rs | |
| parent | Fix ModelError doctest (diff) | |
| download | serenity-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.rs | 3 |
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 { |