about summary refs log tree commit diff
path: root/ExampleBots/ModerationBot/Commands/BanMediaCommand.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ExampleBots/ModerationBot/Commands/BanMediaCommand.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ExampleBots/ModerationBot/Commands/BanMediaCommand.cs b/ExampleBots/ModerationBot/Commands/BanMediaCommand.cs
index 21e0a94..9e49b22 100644
--- a/ExampleBots/ModerationBot/Commands/BanMediaCommand.cs
+++ b/ExampleBots/ModerationBot/Commands/BanMediaCommand.cs
@@ -20,7 +20,7 @@ public class BanMediaCommand(IServiceProvider services, HomeserverProviderServic
         //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(
@@ -31,7 +31,7 @@ public class BanMediaCommand(IServiceProvider services, HomeserverProviderServic
     }
 
     public async Task Invoke(CommandContext ctx) {
-        
+
         var botData = await ctx.Homeserver.GetAccountDataAsync<BotData>("gay.rory.moderation_bot_data");
         var policyRoom = ctx.Homeserver.GetRoom(botData.DefaultPolicyRoom ?? botData.ControlRoom);
         var logRoom = ctx.Homeserver.GetRoom(botData.LogRoom ?? botData.ControlRoom);