diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2024-01-05 12:22:42 +0100 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2024-01-05 12:22:42 +0100 |
commit | f215dca816745ef54f5436d6cea9350d6dcd3982 (patch) | |
tree | 2749bcd4d1297943478b6080d5688ef642ca1d40 /ExampleBots/ModerationBot/ModerationBot.cs | |
parent | ToObject and ToJson for MatrixException (diff) | |
download | LibMatrix-f215dca816745ef54f5436d6cea9350d6dcd3982.tar.xz |
Cleanup
Diffstat (limited to '')
-rw-r--r-- | ExampleBots/ModerationBot/ModerationBot.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ExampleBots/ModerationBot/ModerationBot.cs b/ExampleBots/ModerationBot/ModerationBot.cs index 1be7bd5..7c95229 100644 --- a/ExampleBots/ModerationBot/ModerationBot.cs +++ b/ExampleBots/ModerationBot/ModerationBot.cs @@ -70,7 +70,7 @@ public class ModerationBot(AuthenticatedHomeserverGeneric hs, ILogger<Moderation #pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed Task.Run(async () => { while (!cancellationToken.IsCancellationRequested) { - var controlRoomMembers = _controlRoom.GetMembersAsync(); + var controlRoomMembers = _controlRoom.GetMembersEnumerableAsync(); var pls = await _controlRoom.GetPowerLevelsAsync(); await foreach (var member in controlRoomMembers) { if ((member.TypedContent as RoomMemberEventContent)? @@ -110,8 +110,8 @@ public class ModerationBot(AuthenticatedHomeserverGeneric hs, ILogger<Moderation "Got timeline event in {}: {}", @event.RoomId, @event.ToJson(indent: true, ignoreNull: true)); if (@event != null && ( - @event.GetType.IsAssignableTo(typeof(BasePolicy)) - || @event.GetType.IsAssignableTo(typeof(PolicyRuleEventContent)) + @event.MappedType.IsAssignableTo(typeof(BasePolicy)) + || @event.MappedType.IsAssignableTo(typeof(PolicyRuleEventContent)) )) await engine.ReloadActivePolicyListById(@event.RoomId); |