about summary refs log tree commit diff
path: root/ExampleBots/ModerationBot/Commands/JoinSpaceMembersCommand.cs
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2023-12-01 12:16:00 +0100
committerEmma [it/its]@Rory& <root@rory.gay>2023-12-01 12:16:00 +0100
commit71d115dc8e915a620dd935955ba980fcbe421dad (patch)
treeb836f5b0e1b5955bbc08443f8df6d078bd0fa7ea /ExampleBots/ModerationBot/Commands/JoinSpaceMembersCommand.cs
parentModeration bot work (diff)
downloadLibMatrix-71d115dc8e915a620dd935955ba980fcbe421dad.tar.xz
Cleanup, move ArcaneLibs to submodule instead of parent submodule
Diffstat (limited to 'ExampleBots/ModerationBot/Commands/JoinSpaceMembersCommand.cs')
-rw-r--r--ExampleBots/ModerationBot/Commands/JoinSpaceMembersCommand.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/ExampleBots/ModerationBot/Commands/JoinSpaceMembersCommand.cs b/ExampleBots/ModerationBot/Commands/JoinSpaceMembersCommand.cs
index c3b7d12..6e64f6f 100644
--- a/ExampleBots/ModerationBot/Commands/JoinSpaceMembersCommand.cs
+++ b/ExampleBots/ModerationBot/Commands/JoinSpaceMembersCommand.cs
@@ -21,7 +21,7 @@ public class JoinSpaceMembersCommand(IServiceProvider services, HomeserverProvid
         //check if user is admin in control room
         var botData = await ctx.Homeserver.GetAccountDataAsync<BotData>("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(
@@ -37,9 +37,9 @@ public class JoinSpaceMembersCommand(IServiceProvider services, HomeserverProvid
 
         await logRoom.SendMessageEventAsync(MessageFormatter.FormatSuccess($"Joining space children of {ctx.Args[0]} with reason: {string.Join(' ', ctx.Args[1..])}"));
         var roomId = ctx.Args[0];
-        var servers = new List<string>() {ctx.Homeserver.ServerName};
+        var servers = new List<string>() { ctx.Homeserver.ServerName };
         if (roomId.StartsWith('[')) {
-            
+
         }
 
         if (roomId.StartsWith('#')) {