fix (rooms): Fix order of checks in rent.

This commit is contained in:
2021-09-20 10:58:53 +03:00
parent ab4158ce5b
commit 40e7735a87

View File

@@ -134,17 +134,17 @@ async def cmd_rent(ctx):
if ctx.args: if ctx.args:
# Rent a new room # Rent a new room
# Check that they provided at least one member
if not ctx.msg.mentions:
return await ctx.error_reply(
"Please mention at least one user to add to your new room."
)
to_add = ( to_add = (
member for member in ctx.msg.mentions if member != ctx.author member for member in ctx.msg.mentions if member != ctx.author
) )
to_add = list(set(to_add)) to_add = list(set(to_add))
# Check that they provided at least one member
if not to_add:
return await ctx.error_reply(
"Please mention at least one user to add to your new room."
)
# Check that they didn't provide too many members # Check that they didn't provide too many members
limit = ctx.guild_settings.rent_member_limit.value limit = ctx.guild_settings.rent_member_limit.value
if len(ctx.msg.mentions) > limit: if len(ctx.msg.mentions) > limit: