SteelGolem icon

irc stuff with kishi

SteelGolem | PRO | 01/03/13 04:38:33 PM UTC | 0 ⭐ | 443 👁️ | Never ⏰ | []
C# |

940 B

|

None

|

0 👍

/

0 👎

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string data = ":irc.rizon.net PRIVMSG kishi :!say #SteelGolem hello alll";
            string[] ex = data.Split(' ');
 
            string command = ex[3];
            switch (command)
            {
                case ":!say":
                    string channel = ex[4];
                    int start_of_message = data.IndexOf(channel) + channel.Length + 1;
                    if (start_of_message < data.Length)
                        SendData("PRIVMSG ", data.Substring(start_of_message));
                    break;
            }
        }
 
        static void SendData(string command, string what)
        {
            Console.WriteLine(command + " > " + what);
            Console.ReadKey(false);
        }
    }
}

Comments