RegexBot/RegexbotClient.cs
Noi 1149f2800d Reorganized project
Moved modules into the assembly itself to simplify development of
further features and reduce complexity in building this project.

Additionally, many small adjustments were made, including:
- Add documentation to most public methods that had it missing
- Minor style updates
- Updated readme to reflect near-completion of this rewrite
- Remove any last remaining references to old project name Kerobot
- Update dependencies
2022-07-20 18:55:08 -07:00

39 lines
1.3 KiB
C#

using System.Reflection;
namespace RegexBot;
/// <summary>
/// The RegexBot client instance.
/// </summary>
public partial class RegexbotClient {
/// <summary>
/// Gets application instance configuration.
/// </summary>
internal InstanceConfig Config { get; }
/// <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(InstanceConfig conf, DiscordSocketClient client) {
Config = conf;
DiscordClient = client;
// Get all services started up
_svcLogging = new Services.Logging.LoggingService(this);
_svcGuildState = new Services.ModuleState.ModuleStateService(this);
_svcCommonFunctions = new Services.CommonFunctions.CommonFunctionsService(this);
_svcEntityCache = new Services.EntityCache.EntityCacheService(this);
var ver = Assembly.GetExecutingAssembly().GetName().Version!;
_svcLogging.DoLog(true, nameof(RegexBot), $"{nameof(RegexBot)} v{ver:3} - https://github.com/NoiTheCat/RegexBot");
// Load externally defined functionality
Modules = ModuleLoader.Load(Config, this);
}
}