Fixed Mention.GetUserIds, dont mention the same user multiple times.
This commit is contained in:
@@ -119,7 +119,7 @@ namespace Discord
|
|||||||
private async Task<Message> SendMessage(Channel channel, string text, bool isTextToSpeech)
|
private async Task<Message> SendMessage(Channel channel, string text, bool isTextToSpeech)
|
||||||
{
|
{
|
||||||
Message msg;
|
Message msg;
|
||||||
var userIds = !channel.IsPrivate ? Mention.GetUserIds(text) : new string[0];
|
var userIds = !channel.IsPrivate ? Mention.GetUserIds(text).Distinct() : new string[0];
|
||||||
if (Config.UseMessageQueue)
|
if (Config.UseMessageQueue)
|
||||||
{
|
{
|
||||||
var nonce = GenerateNonce();
|
var nonce = GenerateNonce();
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ namespace Discord
|
|||||||
{
|
{
|
||||||
public static class Mention
|
public static class Mention
|
||||||
{
|
{
|
||||||
private static readonly Regex _userRegex = new Regex(@"<@(?:[0-9]+?)>", RegexOptions.Compiled);
|
private static readonly Regex _userRegex = new Regex(@"<@([0-9]+?)>", RegexOptions.Compiled);
|
||||||
private static readonly Regex _channelRegex = new Regex(@"<#(?:[0-9]+?)>", RegexOptions.Compiled);
|
private static readonly Regex _channelRegex = new Regex(@"<#([0-9]+?)>", RegexOptions.Compiled);
|
||||||
|
|
||||||
/// <summary> Returns the string used to create a user mention. </summary>
|
/// <summary> Returns the string used to create a user mention. </summary>
|
||||||
public static string User(User user)
|
public static string User(User user)
|
||||||
|
|||||||
Reference in New Issue
Block a user