Browse Source

Fixed mention cleanup removing @/# characters

tags/docs-0.9
RogueException 9 years ago
parent
commit
6da8256cc5
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/Discord.Net/Helpers/Mention.cs

+ 3
- 3
src/Discord.Net/Helpers/Mention.cs View File

@@ -28,16 +28,16 @@ namespace Discord
if (user != null)
return '@' + user.Name;
else //User not found
return e.Value;
return '@' + e.Value;
}));
text = _channelRegex.Replace(text, new MatchEvaluator(e =>
{
string id = e.Value.Substring(2, e.Value.Length - 3);
var channel = client.Channels[id];
if (channel != null && channel.Server.Id == server.Id)
return channel.Name;
return '#' + channel.Name;
else //Channel not found
return e.Value;
return '#' + e.Value;
}));
return text;
}


Loading…
Cancel
Save