All pastes #20048 Raw Edit

Something

public text v1 · immutable
#20048 ·published 2005-08-15 08:41 UTC
rendered paste body
using System;
using System.Collections;
using System.Threading;
using Meebey.SmartIrc4net;

namespace Bot
{
    public class CSBot
    {
        public static IrcClient irc = new IrcClient();

        public static void Main(string[] args)
        {
            string server = "irc.irchighway.net";
            string chan = "#test";
            int port = 6667;

            try
            {
                irc.Connect(server, port);
                Console.WriteLine("CSBot Connected");
            }

            catch (ConnectionException e)
            {
                Console.WriteLine("Error: " + e.Message);
            }

            try
            {
                irc.Login("CSbot", "K");
                irc.RfcJoin(chan);
                irc.SendMessage(SendType.Message, chan, "Hey");
            }

            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}