tell the user their power level

This commit is contained in:
Nexus 2024-09-15 23:11:32 +01:00
parent f0d5e13c1f
commit ac75e02b91

View file

@ -92,7 +92,7 @@ class MSCGetter(niobot.Module):
async def auto_msc_enable(self, ctx: niobot.Context):
"""Automatically enables MSC linking. Requires a power level of at least 50."""
if (sp := ctx.room.power_levels.users.get(ctx.message.sender, -999)) < 50:
return await ctx.respond("You need to have at least a power level of 50 to use this.")
return await ctx.respond(f"You need to have at least a power level of 50 to use this (you have {sp}).")
key = self.bot.redis_key(ctx.room.room_id, "auto_msc.enabled")
exists = await self.bot.redis.get(key)
if exists:
@ -107,7 +107,7 @@ class MSCGetter(niobot.Module):
async def auto_msc_disable(self, ctx: niobot.Context):
"""Disables automatic MSC linking. Requires a power level of at least 50."""
if (sp := ctx.room.power_levels.users.get(ctx.message.sender, -999)) < 50:
return await ctx.respond("You need to have at least a power level of 50 to use this.")
return await ctx.respond(f"You need to have at least a power level of 50 to use this (you have {sp}).")
key = self.bot.redis_key(ctx.room.room_id, "auto_msc.enabled")
exists = await self.bot.redis.get(key)
if exists: