diff options
author | Rory& <root@rory.gay> | 2024-05-30 19:07:09 +0000 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-05-30 19:07:09 +0000 |
commit | cf90f02e1f9c9f7d037976cace2b9c49119c741c (patch) | |
tree | 3925bd8d689c3f330c217b0f867ba8a241d893e7 /Utilities/LibMatrix.Utilities.Bot | |
parent | Rename legacy event types (diff) | |
download | LibMatrix-cf90f02e1f9c9f7d037976cace2b9c49119c741c.tar.xz |
Start implementing new event system
Diffstat (limited to '')
-rw-r--r-- | Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs | 16 | ||||
-rw-r--r-- | Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs b/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs index 46638e4..45118b3 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs @@ -41,14 +41,14 @@ public class CommandListenerHostedService : IHostedService { private async Task? Run(CancellationToken cancellationToken) { _logger.LogInformation("Starting command listener!"); - var filter = await _hs.NamedCaches.FilterCache.GetOrSetValueAsync("gay.rory.libmatrix.utilities.bot.command_listener_syncfilter.dev2", new SyncFilter() { - AccountData = new SyncFilter.EventFilter(notTypes: ["*"], limit: 1), - Presence = new SyncFilter.EventFilter(notTypes: ["*"]), - Room = new SyncFilter.RoomFilter() { - AccountData = new SyncFilter.RoomFilter.StateFilter(notTypes: ["*"]), - Ephemeral = new SyncFilter.RoomFilter.StateFilter(notTypes: ["*"]), - State = new SyncFilter.RoomFilter.StateFilter(notTypes: ["*"]), - Timeline = new SyncFilter.RoomFilter.StateFilter(types: ["m.room.message"], notSenders: [_hs.WhoAmI.UserId]), + var filter = await _hs.NamedCaches.FilterCache.GetOrSetValueAsync("gay.rory.libmatrix.utilities.bot.command_listener_syncfilter.dev2", new MatrixFilter() { + AccountData = new MatrixFilter.EventFilter(notTypes: ["*"], limit: 1), + Presence = new MatrixFilter.EventFilter(notTypes: ["*"]), + Room = new MatrixFilter.RoomFilter() { + AccountData = new MatrixFilter.RoomFilter.StateFilter(notTypes: ["*"]), + Ephemeral = new MatrixFilter.RoomFilter.StateFilter(notTypes: ["*"]), + State = new MatrixFilter.RoomFilter.StateFilter(notTypes: ["*"]), + Timeline = new MatrixFilter.RoomFilter.StateFilter(types: ["m.room.message"], notSenders: [_hs.WhoAmI.UserId]), } }); diff --git a/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs b/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs index c2aed04..b49a8e3 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs @@ -31,14 +31,14 @@ public class InviteHandlerHostedService : IHostedService { private async Task? Run(CancellationToken cancellationToken) { _logger.LogInformation("Starting invite listener!"); - var filter = await _hs.NamedCaches.FilterCache.GetOrSetValueAsync("gay.rory.libmatrix.utilities.bot.command_listener_syncfilter.dev2", new SyncFilter() { - AccountData = new SyncFilter.EventFilter(notTypes: ["*"], limit: 1), - Presence = new SyncFilter.EventFilter(notTypes: ["*"]), - Room = new SyncFilter.RoomFilter() { - AccountData = new SyncFilter.RoomFilter.StateFilter(notTypes: ["*"]), - Ephemeral = new SyncFilter.RoomFilter.StateFilter(notTypes: ["*"]), - State = new SyncFilter.RoomFilter.StateFilter(notTypes: ["*"]), - Timeline = new SyncFilter.RoomFilter.StateFilter(types: ["m.room.message"], notSenders: [_hs.WhoAmI.UserId]), + var filter = await _hs.NamedCaches.FilterCache.GetOrSetValueAsync("gay.rory.libmatrix.utilities.bot.command_listener_syncfilter.dev2", new MatrixFilter() { + AccountData = new MatrixFilter.EventFilter(notTypes: ["*"], limit: 1), + Presence = new MatrixFilter.EventFilter(notTypes: ["*"]), + Room = new MatrixFilter.RoomFilter() { + AccountData = new MatrixFilter.RoomFilter.StateFilter(notTypes: ["*"]), + Ephemeral = new MatrixFilter.RoomFilter.StateFilter(notTypes: ["*"]), + State = new MatrixFilter.RoomFilter.StateFilter(notTypes: ["*"]), + Timeline = new MatrixFilter.RoomFilter.StateFilter(types: ["m.room.message"], notSenders: [_hs.WhoAmI.UserId]), } }); |