about summary refs log tree commit diff
path: root/Jenny/JennyBot.cs
diff options
context:
space:
mode:
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!");
+    }
+
+}