RegexBot/RegexbotClient.cs

41 lines
1.4 KiB
C#
Raw Normal View History

using System.Reflection;
namespace RegexBot;
/// <summary>
/// The RegexBot client instance.
/// </summary>
public partial class RegexbotClient {
/// <summary>
/// Gets application instance configuration.
/// </summary>
internal Configuration Config { get; }
2018-05-11 06:13:00 +00:00
/// <summary>
/// Gets the Discord client instance.
/// </summary>
public DiscordSocketClient DiscordClient { get; }
/// <summary>
/// Gets all loaded modules in an iterable form.
/// </summary>
internal IReadOnlyCollection<RegexbotModule> Modules { get; }
internal RegexbotClient(Configuration conf, DiscordSocketClient client) {
Config = conf;
DiscordClient = client;
2018-05-11 06:13:00 +00:00
// Get all services started up
_svcLogging = new Services.Logging.LoggingService(this);
_svcSharedEvents = new Services.SharedEventService.SharedEventService(this);
_svcGuildState = new Services.ModuleState.ModuleStateService(this, conf.ServerConfigs);
_svcCommonFunctions = new Services.CommonFunctions.CommonFunctionsService(this);
_svcEntityCache = new Services.EntityCache.EntityCacheService(this);
2018-05-11 06:13:00 +00:00
var ver = Assembly.GetExecutingAssembly().GetName().Version!.ToString(3);
_svcLogging.DoLog(nameof(RegexBot), $"{nameof(RegexBot)} v{ver} - https://github.com/NoiTheCat/RegexBot");
// Load externally defined functionality
Modules = ModuleLoader.Load(Config, this);
}
}