diff options
| author | Illia <[email protected]> | 2017-04-20 00:51:34 +0300 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-04-19 14:51:34 -0700 |
| commit | 31aae7d12763f94a7a08ea9fd0102921e8402241 (patch) | |
| tree | 76e0b54954ee02140ad6bd409a73e16943bda5f8 /src/model | |
| parent | Fix example in README (diff) | |
| download | serenity-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.rs | 7 |
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. |