RegexBot/Program.cs
Noikoio 27a25d90fc Added BotFeature base class, implemented in RegexResponder
BotFeature is a new base class that all new individual bot features
will derive from. At least one new feature is planned for this bot,
and in time it may be opened up so external assemblies can be loaded.

Full list of changes:
-Added BotFeature and ConfigSectionAttribute classes
-Renamed ConfigLoader to Configuration
-Removed RegexResponder specific configuration data
-Added per-feature configuration data storage
-LoadInitialConfig() no longer loads all configuration
-ReloadServerConfig() now loads remaining configuration, and allows
 for actual configuration reloading. Live configuration reloading
 is not an exposed feature yet.
-Can now delegate feature-specific configuration loading to feature
 classes that make use of ConfigSectionAttribute

-RegexResponder fully implements BotFeature
-Rule configuration loading moved to RegexResponder
-Logging output has changed slightly in regards to rule triggering
 and execution

-Changed configuration load behavior on startup
-Version pushed up to 1.0.0
2017-07-26 15:36:59 -07:00

32 lines
No EOL
1 KiB
C#

using System;
namespace Noikoio.RegexBot
{
/// <summary>
/// Program entry point. Sets up handling of certain events and does initial
/// configuration loading before starting the Discord client.
/// </summary>
class Program
{
static void Main(string[] args)
{
RegexBot rb = new RegexBot();
Console.CancelKeyPress += rb.Console_CancelKeyPress;
//AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
rb.Start().GetAwaiter().GetResult();
}
// TODO Re-implement this once the framework allows for it again.
//private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
//{
// var l = _logger.SetPrefix("Runtime");
// string[] lines = Regex.Split(e.ExceptionObject.ToString(), "\r\n|\r|\n");
// foreach (string line in lines)
// {
// l.Log(line).Wait();
// }
//}
}
}