using IrcDotNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Concilium.Bot
{
    public static class IrcClientExtensions
    {
        public static IrcChannel GetChannel(this IrcClient _client, string _sChannelName)
        {
            return _client.Channels.FirstOrDefault(c => c.Name == _sChannelName);
        }

        public static IrcUser GetUser(this IrcClient _client, string _sNickName)
        {
            return _client.Users.FirstOrDefault(u => u.NickName == _sNickName);
        }

        public static IrcChannelUser GetUser(this IrcChannel _channel, string _sNickName)
        {
            return _channel.Users.FirstOrDefault(u => u.User.NickName == _sNickName);
        }
    }
}
