Added Mention.Clean
This commit is contained in:
@@ -23,6 +23,7 @@ namespace Discord
|
|||||||
protected readonly DiscordClient _client;
|
protected readonly DiscordClient _client;
|
||||||
private bool _isCached;
|
private bool _isCached;
|
||||||
|
|
||||||
|
internal DiscordClient Client => _client;
|
||||||
internal bool IsCached => _isCached;
|
internal bool IsCached => _isCached;
|
||||||
|
|
||||||
internal CachedObject(DiscordClient client)
|
internal CachedObject(DiscordClient client)
|
||||||
|
|||||||
@@ -64,5 +64,19 @@ namespace Discord
|
|||||||
return e.Value;
|
return e.Value;
|
||||||
}));
|
}));
|
||||||
}*/
|
}*/
|
||||||
}
|
|
||||||
|
/// <summary>Resolves all mentions in a provided string to those users, channels or roles' names.</summary>
|
||||||
|
internal static string Clean(Message msg, string text)
|
||||||
|
{
|
||||||
|
var client = msg.Client;
|
||||||
|
var server = msg.Server;
|
||||||
|
text = Mention.CleanUserMentions(client, server, text);
|
||||||
|
if (server != null)
|
||||||
|
{
|
||||||
|
text = Mention.CleanChannelMentions(client, server, text);
|
||||||
|
//text = Mention.CleanRoleMentions(_client, User, channel, text);
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user