aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorIllia <[email protected]>2017-04-20 00:51:34 +0300
committerZeyla Hellyer <[email protected]>2017-04-19 14:51:34 -0700
commit31aae7d12763f94a7a08ea9fd0102921e8402241 (patch)
tree76e0b54954ee02140ad6bd409a73e16943bda5f8 /src/model
parentFix example in README (diff)
downloadserenity-31aae7d12763f94a7a08ea9fd0102921e8402241.tar.xz
serenity-31aae7d12763f94a7a08ea9fd0102921e8402241.zip
Update the way errors are handled in dispatch
Diffstat (limited to 'src/model')
-rw-r--r--src/model/channel/message.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs
index 029914d..f572aea 100644
--- a/src/model/channel/message.rs
+++ b/src/model/channel/message.rs
@@ -195,7 +195,12 @@ impl Message {
// First replace all user mentions.
for u in &self.mentions {
- result = result.replace(&u.mention(), &u.distinct());
+ let mut at_distinct = String::with_capacity(38);
+ at_distinct.push('@');
+ at_distinct.push_str(&u.name);
+ at_distinct.push('#');
+ at_distinct.push_str(&u.discriminator);
+ result = result.replace(&u.mention(), &at_distinct);
}
// Then replace all role mentions.