diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2024-01-24 02:28:54 +0100 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2024-01-24 02:28:54 +0100 |
commit | ecda7b17dfd83d787bc12d7194103d20cd4a8354 (patch) | |
tree | 5e79ac768297e117a8acaf3bf30574dae33df71d | |
parent | Cleanup (diff) | |
download | LibMatrix.ExampleBot-ecda7b17dfd83d787bc12d7194103d20cd4a8354.tar.xz |
MessageBuilder extensions
-rw-r--r-- | Bot/RMUBot.cs (renamed from Bot/MRUBot.cs) | 10 | ||||
-rw-r--r-- | Bot/RMUBotConfiguration.cs (renamed from Bot/MRUBotConfiguration.cs) | 4 | ||||
-rw-r--r-- | Bot/StartupTasks/ServerRoomSizeCalulator.cs | 4 | ||||
-rw-r--r-- | Program.cs | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/Bot/MRUBot.cs b/Bot/RMUBot.cs index 8e6cd6a..de47ec6 100644 --- a/Bot/MRUBot.cs +++ b/Bot/RMUBot.cs @@ -12,14 +12,14 @@ using Microsoft.Extensions.Logging; namespace LibMatrix.ExampleBot.Bot; -public class MRUBot : IHostedService { +public class RMUBot : IHostedService { private readonly HomeserverProviderService _homeserverProviderService; - private readonly ILogger<MRUBot> _logger; - private readonly MRUBotConfiguration _configuration; + private readonly ILogger<RMUBot> _logger; + private readonly RMUBotConfiguration _configuration; private readonly IEnumerable<ICommand> _commands; - public MRUBot(HomeserverProviderService homeserverProviderService, ILogger<MRUBot> logger, - MRUBotConfiguration configuration, IServiceProvider services) { + public RMUBot(HomeserverProviderService homeserverProviderService, ILogger<RMUBot> logger, + RMUBotConfiguration configuration, IServiceProvider services) { logger.LogInformation("{} instantiated!", this.GetType().Name); _homeserverProviderService = homeserverProviderService; _logger = logger; diff --git a/Bot/MRUBotConfiguration.cs b/Bot/RMUBotConfiguration.cs index dcdfc4c..9edc4bd 100644 --- a/Bot/MRUBotConfiguration.cs +++ b/Bot/RMUBotConfiguration.cs @@ -2,8 +2,8 @@ using Microsoft.Extensions.Configuration; namespace LibMatrix.ExampleBot.Bot; -public class MRUBotConfiguration { - public MRUBotConfiguration(IConfiguration config) { +public class RMUBotConfiguration { + public RMUBotConfiguration(IConfiguration config) { config.GetRequiredSection("Bot").Bind(this); } public string Homeserver { get; set; } = ""; diff --git a/Bot/StartupTasks/ServerRoomSizeCalulator.cs b/Bot/StartupTasks/ServerRoomSizeCalulator.cs index 2f6e0b0..0645668 100644 --- a/Bot/StartupTasks/ServerRoomSizeCalulator.cs +++ b/Bot/StartupTasks/ServerRoomSizeCalulator.cs @@ -10,11 +10,11 @@ namespace LibMatrix.ExampleBot.Bot.StartupTasks; public class ServerRoomSizeCalulator : IHostedService { private readonly HomeserverProviderService _homeserverProviderService; private readonly ILogger<ServerRoomSizeCalulator> _logger; - private readonly MRUBotConfiguration _configuration; + private readonly RMUBotConfiguration _configuration; private readonly IEnumerable<ICommand> _commands; public ServerRoomSizeCalulator(HomeserverProviderService homeserverProviderService, ILogger<ServerRoomSizeCalulator> logger, - MRUBotConfiguration configuration, IServiceProvider services) { + RMUBotConfiguration configuration, IServiceProvider services) { logger.LogInformation("Server room size calculator hosted service instantiated!"); _homeserverProviderService = homeserverProviderService; _logger = logger; diff --git a/Program.cs b/Program.cs index 25ce07d..86d7598 100644 --- a/Program.cs +++ b/Program.cs @@ -16,7 +16,7 @@ var host = Host.CreateDefaultBuilder(args).ConfigureServices((_, services) => { dataStorageProvider: new FileStorageProvider("bot_data/data/") ) ); - services.AddScoped<MRUBotConfiguration>(); + services.AddScoped<RMUBotConfiguration>(); services.AddRoryLibMatrixServices(); foreach (var commandClass in new ClassCollector<ICommand>().ResolveFromAllAccessibleAssemblies()) { Console.WriteLine($"Adding command {commandClass.Name}"); @@ -24,7 +24,7 @@ var host = Host.CreateDefaultBuilder(args).ConfigureServices((_, services) => { } // services.AddHostedService<ServerRoomSizeCalulator>(); - services.AddHostedService<MRUBot>(); + services.AddHostedService<RMUBot>(); }).UseConsoleLifetime().Build(); await host.RunAsync(); |