about summary refs log tree commit diff
path: root/Jenny/JennyBot.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-06-03 20:19:21 +0200
committerRory& <root@rory.gay>2024-06-03 20:19:21 +0200
commit49eba40d2bc6a98553e57e6f9b8496ff649147a8 (patch)
treebf79603c455ef65b7cfa349cbce285cedd8bf53a /Jenny/JennyBot.cs
downloadJenny-github/master.tar.xz
Initial commit github/master
Diffstat (limited to 'Jenny/JennyBot.cs')
-rw-r--r--Jenny/JennyBot.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/Jenny/JennyBot.cs b/Jenny/JennyBot.cs
new file mode 100644

index 0000000..2ba835d --- /dev/null +++ b/Jenny/JennyBot.cs
@@ -0,0 +1,32 @@ +using LibMatrix.Homeservers; +using LibMatrix.RoomTypes; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +namespace Jenny; + +public class JennyBot(AuthenticatedHomeserverGeneric hs, ILogger<JennyBot> logger, JennyConfiguration configuration) : IHostedService { + private Task _listenerTask; + + // private GenericRoom _policyRoom; + private GenericRoom? _logRoom; + private GenericRoom? _controlRoom; + + /// <summary>Triggered when the application host is ready to start the service.</summary> + /// <param name="cancellationToken">Indicates that the start process has been aborted.</param> + public async Task StartAsync(CancellationToken cancellationToken) { + _listenerTask = Run(cancellationToken); + logger.LogInformation("Bot started!"); + } + + private async Task Run(CancellationToken cancellationToken) { + + } + + /// <summary>Triggered when the application host is performing a graceful shutdown.</summary> + /// <param name="cancellationToken">Indicates that the shutdown process should no longer be graceful.</param> + public async Task StopAsync(CancellationToken cancellationToken) { + logger.LogInformation("Shutting down bot!"); + } + +}