tell the user their power level
This commit is contained in:
parent
f0d5e13c1f
commit
ac75e02b91
1 changed files with 2 additions and 2 deletions
|
@ -92,7 +92,7 @@ class MSCGetter(niobot.Module):
|
||||||
async def auto_msc_enable(self, ctx: niobot.Context):
|
async def auto_msc_enable(self, ctx: niobot.Context):
|
||||||
"""Automatically enables MSC linking. Requires a power level of at least 50."""
|
"""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:
|
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")
|
key = self.bot.redis_key(ctx.room.room_id, "auto_msc.enabled")
|
||||||
exists = await self.bot.redis.get(key)
|
exists = await self.bot.redis.get(key)
|
||||||
if exists:
|
if exists:
|
||||||
|
@ -107,7 +107,7 @@ class MSCGetter(niobot.Module):
|
||||||
async def auto_msc_disable(self, ctx: niobot.Context):
|
async def auto_msc_disable(self, ctx: niobot.Context):
|
||||||
"""Disables automatic MSC linking. Requires a power level of at least 50."""
|
"""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:
|
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")
|
key = self.bot.redis_key(ctx.room.room_id, "auto_msc.enabled")
|
||||||
exists = await self.bot.redis.get(key)
|
exists = await self.bot.redis.get(key)
|
||||||
if exists:
|
if exists:
|
||||||
|
|
Loading…
Reference in a new issue