diff --git a/src/main.py b/src/main.py index 294bbb1..3fd9bbd 100644 --- a/src/main.py +++ b/src/main.py @@ -44,6 +44,16 @@ async def generate( ephemeral=True ) return + + MAX_PROMPT_LENGTH = 500 + + if len(prompt) > MAX_PROMPT_LENGTH: + await interaction.followup.send(f"Prompt too long! Maximum {MAX_PROMPT_LENGTH} chars allowed.") + return + + if len(negative) > MAX_PROMPT_LENGTH: + await interaction.followup.send(f"Negative Prompt too long! Maximum {MAX_PROMPT_LENGTH} chars allowed.") + return await interaction.response.defer(thinking=True)