My friend and I are writing an IRC C# bot, and we are looking for a way to include a module system so that users can write custom modules to extend function.

The bot uses Regex to split up all raw data from the server, and then triggers the appropriate event with the data. For example, a typical event handler might look like:

OnChannelMessage(object sender, ChannelMessageEventArgs e)
{
}

In ChannelMessageEventArgs would be the channel name, the nick of the sender, message etc...

I'd like to have a plugin system so that people can build modules and load / unload them at will, when the bot loads, or while its running.

Ideally I'd like to be able to compile the .cs files on the fly, and in the plugin.cs file, would be a few things:

  1. what event to capture, for example, OnChannelMessage, and the Channeldata in OnChannelEventArgs
  2. what to do when this information is given,
  3. a help text in (that i can call from inside the main bot.. so say a string, help = "this is the help for this plugin" that can be returned at any time without actually calling the plugin)
  4. what the plugin name is etc

Thanks for any ideas on where to start for someone who is relatively new at programming.

Edit
Report