FindChannels limits #channel format to text channels only.

This commit is contained in:
RogueException
2015-11-02 14:12:51 -04:00
parent ab9368f565
commit dcdea2b380

View File

@@ -98,10 +98,10 @@ namespace Discord
if (channel != null) if (channel != null)
query = query.Concat(new Channel[] { channel }); query = query.Concat(new Channel[] { channel });
} }
else if (name[0] == '#') //If we somehow get text starting with # but isn't a mention else if (name[0] == '#' && (type == (ChannelType)null || type == ChannelType.Text)) //If we somehow get text starting with # but isn't a mention
{ {
string name2 = name.Substring(1); string name2 = name.Substring(1);
query = query.Concat(server.Channels.Where(x => string.Equals(x.Name, name2, StringComparison.OrdinalIgnoreCase))); query = query.Concat(server.TextChannels.Where(x => string.Equals(x.Name, name2, StringComparison.OrdinalIgnoreCase)));
} }
} }