aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeyla <[email protected]>2017-04-25 13:22:47 -0700
committerGitHub <[email protected]>2017-04-25 13:22:47 -0700
commite76f78e1c4d00f1bb0a193f8a9482960fa334e6f (patch)
treec85671ca397f4c9d572eec901f53c4443ee52e1e /src
parentFix deserialization for Ids (diff)
downloadserenity-e76f78e1c4d00f1bb0a193f8a9482960fa334e6f.tar.xz
serenity-e76f78e1c4d00f1bb0a193f8a9482960fa334e6f.zip
Fix embed length check
Diffstat (limited to 'src')
-rw-r--r--src/model/channel/message.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs
index 11855b8..5dc59a1 100644
--- a/src/model/channel/message.rs
+++ b/src/model/channel/message.rs
@@ -488,10 +488,10 @@ impl Message {
total += title.len();
}
- if total > constants::EMBED_MAX_LENGTH as usize {
+ if total <= constants::EMBED_MAX_LENGTH as usize {
Ok(())
} else {
- let overflow = constants::EMBED_MAX_LENGTH as u64 - total as u64;
+ let overflow = total as u64 - constants::EMBED_MAX_LENGTH as u64;
Err(Error::Client(ClientError::EmbedTooLarge(overflow)))
}