Example #1
0
        public async Task LoginAsync(IIrcLoginSettings loginSettings, CancellationToken ct = default)
        {
            await _lineCommunicator.ConnectAsync(ct);

            if (loginSettings.Password != null)
            {
                await SetPasswordAsync(loginSettings.Password);
            }

            if (loginSettings.Nick != null)
            {
                await SetNickAsync(loginSettings.Nick);
            }

            if (loginSettings.User != null)
            {
                await SetUserAsync(loginSettings.User);
            }

            while (IsLoggedIn == false)
            {
                await Task.Delay(50, ct);
            }

            foreach (var channel in loginSettings.Channels)
            {
                await JoinChannelAsync(channel);
            }
        }
Example #2
0
        public async Task ConnectAsync(CancellationToken ct = default)
        {
            Console.WriteLine("->> Connecting...");
            await _inner.ConnectAsync();

            Console.WriteLine("<<- Connected.");
        }