1
Fork 0
mirror of https://github.com/RGBCube/minearchy-bot synced 2025-07-27 08:57:46 +00:00

Fix errors

This commit is contained in:
RGBCube 2022-12-17 15:13:57 +03:00
parent 8b7be6b886
commit f1af800e10

View file

@ -73,20 +73,25 @@ class Miscellaneous(
return return
await message.author.edit(nick=name[5:]) await message.author.edit(nick=name[5:])
await message.channel.send( await message.channel.send(f"Welcome back {escape_markdown(message.author.mention)}! I've unset your AFK status.")
f"Welcome back {escape_markdown(message.author.mention)}! I've unset your AFK status.")
@command( @command(
brief="Sets you as AFK.", brief="Sets you as AFK.",
help="Sets you as AFK.", help="Sets you as AFK.",
) )
async def afk(self, ctx: Context) -> None: async def afk(self, ctx: Context) -> None:
if ctx.me.top_role.position <= ctx.author.top_role.position: # no error cuz it will un-afk them
await ctx.reply( if ctx.author.display_name.lower().startswith("[AFK]"):
"I cannot set you as AFK because my role is lower than yours. You can edit your nickname to set yourself as AFK (Add [AFK] to the start of it.).")
return return
await ctx.author.edit(nick=f"[AFK] {ctx.author.display_name}") if ctx.me.top_role.position <= ctx.author.top_role.position:
await ctx.reply(
"I cannot set you as AFK because my role is lower than yours."
"You can edit your nickname to set yourself as AFK (Add [AFK] to the start of it.)."
)
return
await ctx.author.edit(nick=f"[AFK] {ctx.author.display_name}"[:32])
await ctx.reply("Set your status to AFK. You can now touch grass freely 🌲.") await ctx.reply("Set your status to AFK. You can now touch grass freely 🌲.")
@Cog.listener() @Cog.listener()