Added exactMatch option to FindChannels

This commit is contained in:
RogueException
2015-10-25 01:08:50 -03:00
parent 4eb52be32d
commit 78c097fa42

View File

@@ -56,12 +56,13 @@ namespace Discord
/// <summary> Returns all channels with the specified server and name. </summary>
/// <remarks> Name formats supported: Name and #Name. Search is case-insensitive. </remarks>
public IEnumerable<Channel> FindChannels(Server server, string name, ChannelType type = null)
public IEnumerable<Channel> FindChannels(Server server, string name, ChannelType type = null, bool exactMatch = false)
{
if (server == null) throw new ArgumentNullException(nameof(server));
CheckReady();
IEnumerable<Channel> result;
if (name.StartsWith("#"))
if (!exactMatch && name.StartsWith("#"))
{
string name2 = name.Substring(1);
result = _channels.Where(x => x.Server == server &&