restrict password length

This commit is contained in:
CAG2Mark 2024-04-29 00:08:15 +08:00
parent 0bcb1452d5
commit 97d0c05058

2
bot.py
View file

@ -92,7 +92,7 @@ class Bot:
description='Set your password on this guild. DO NOT use the same password elsewhere.',
dm_permission=False)
async def set_password_command(inter: disnake.ApplicationCommandInteraction,
password: str = commands.Param(default="", name="password", description="The password to set.")):
password: str = commands.Param(default="", name="password", description="The password to set.", min_length=6, max_length=51)):
pw = self.data.get_user_password_hashsalt(inter.guild_id, inter.user.id)
sudo_role = self.data.get_guild_role(inter.guild_id)
has_sudo_role = any([r.id == sudo_role for r in inter.user.roles])