2022-03-29 05:03:01 +00:00
|
|
|
|
namespace RegexBot.Services;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Base class for services.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Services provide core and shared functionality for this program. Modules are expected to call into services
|
|
|
|
|
/// directly or indirectly in order to access bot features.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
internal abstract class Service {
|
|
|
|
|
public RegexbotClient BotClient { get; }
|
2018-05-06 20:09:17 +00:00
|
|
|
|
|
2022-03-29 05:03:01 +00:00
|
|
|
|
public string Name => GetType().Name;
|
2018-05-11 06:13:00 +00:00
|
|
|
|
|
2022-03-29 05:03:01 +00:00
|
|
|
|
public Service(RegexbotClient bot) => BotClient = bot;
|
2018-05-11 06:13:00 +00:00
|
|
|
|
|
2022-03-29 05:03:01 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Emits a log message.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="message">The log message to send. Multi-line messages are acceptable.</param>
|
2022-07-28 02:23:49 +00:00
|
|
|
|
protected void Log(string message) => BotClient._svcLogging.DoLog(Name, message);
|
2018-05-06 20:09:17 +00:00
|
|
|
|
}
|