ircsharp/Sample/Program.cs

31 lines
789 B
C#
Raw Normal View History

using IrcTokens;
using System;
2020-04-22 15:42:09 +00:00
using System.Collections.Generic;
namespace TokensSample
2020-04-22 15:42:09 +00:00
{
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" }
2020-04-22 15:42:09 +00:00
};
Console.WriteLine(line2);
Console.WriteLine(line2.Format());
// stateful example
var client = new Client();
client.Start();
}
}
}