about summary refs log tree commit diff
path: root/Sample/Program.cs
blob: 68001795f2b69b0e66ddaa66ed6e7670a9266c6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using IrcTokens;

namespace Sample
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // tokenization
            var line = new Line("@id=123 :ben!~ben@hostname PRIVMSG #channel :hello there!");
            Console.WriteLine(line);
            Console.WriteLine(line.Format());

            // formatting
            var line2 = new Line
            {
                Command = "USER",
                Params = new List<string> {"user", "0", "*", "real name"}
            };
            Console.WriteLine(line2);
            Console.WriteLine(line2.Format());

            // stateful example
            var client = new Client();
            client.Start();
        }
    }
}