From 71d115dc8e915a620dd935955ba980fcbe421dad Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Fri, 1 Dec 2023 12:16:00 +0100 Subject: Cleanup, move ArcaneLibs to submodule instead of parent submodule --- .../ModerationBot/Commands/DbgAllRoomsArePolicyListsCommand.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ExampleBots/ModerationBot/Commands/DbgAllRoomsArePolicyListsCommand.cs') diff --git a/ExampleBots/ModerationBot/Commands/DbgAllRoomsArePolicyListsCommand.cs b/ExampleBots/ModerationBot/Commands/DbgAllRoomsArePolicyListsCommand.cs index 09d3caf..327a9a4 100644 --- a/ExampleBots/ModerationBot/Commands/DbgAllRoomsArePolicyListsCommand.cs +++ b/ExampleBots/ModerationBot/Commands/DbgAllRoomsArePolicyListsCommand.cs @@ -26,7 +26,7 @@ public class DbgAllRoomsArePolicyListsCommand //check if user is admin in control room var botData = await ctx.Homeserver.GetAccountDataAsync("gay.rory.moderation_bot_data"); var controlRoom = ctx.Homeserver.GetRoom(botData.ControlRoom); - var isAdmin = (await controlRoom.GetPowerLevelsAsync())!.UserHasPermission(ctx.MessageEvent.Sender, "m.room.ban"); + var isAdmin = (await controlRoom.GetPowerLevelsAsync())!.UserHasStatePermission(ctx.MessageEvent.Sender, "m.room.ban"); if (!isAdmin) { // await ctx.Reply("You do not have permission to use this command!"); await ctx.Homeserver.GetRoom(botData.LogRoom!).SendMessageEventAsync( @@ -39,9 +39,9 @@ public class DbgAllRoomsArePolicyListsCommand public async Task Invoke(CommandContext ctx) { var botData = await ctx.Homeserver.GetAccountDataAsync("gay.rory.moderation_bot_data"); logRoom = ctx.Homeserver.GetRoom(botData.LogRoom ?? botData.ControlRoom); - + var joinedRooms = await ctx.Homeserver.GetJoinedRooms(); - + await ctx.Homeserver.SetAccountDataAsync("gay.rory.moderation_bot.policy_lists", joinedRooms.ToDictionary(x => x.RoomId, x => new PolicyList() { Trusted = true })); @@ -60,4 +60,4 @@ public class DbgAllRoomsArePolicyListsCommand return true; } -} \ No newline at end of file +} -- cgit 1.4.1