title: Best way to set up a modular program in C#
body: <p>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.</p>
  
  <p>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:</p>
  
  <pre><code>OnChannelMessage(object sender, ChannelMessageEventArgs e)
  {
  }
  </code></pre>
  
  <p>In <code>ChannelMessageEventArgs</code> would be the channel name, the nick of the sender, message etc...</p>
  
  <p>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.</p>
  
  <p>Ideally I'd like to be able to compile the <code>.cs</code> files on the fly, and in the plugin.cs file, would be a few things:</p>
  
  <ol>
  <li>what event to capture, for example, OnChannelMessage, and the Channeldata in OnChannelEventArgs</li>
  <li>what to do when this information is given,</li>
  <li>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)</li>
  <li>what the plugin name is etc</li>
  </ol>
  
  <p>Thanks for any ideas on where to start for someone who is relatively new at programming.</p>