Exemplo n.º 1
0
        public static DiscordChannel ChannelByNameOrId(this DiscordGuild guild, string channelNameOrId)
        {
            if (guild == null)
            {
                return(null);
            }

            var maybeChannelId = TryParseSnowflakeId(channelNameOrId);

            return(maybeChannelId != null?guild.GetChannel(maybeChannelId.Value) : guild.ChannelByName(channelNameOrId));
        }