added maximum chars
All checks were successful
Build and Push Docker Image / build (push) Successful in -9s
All checks were successful
Build and Push Docker Image / build (push) Successful in -9s
This commit is contained in:
parent
992615a42f
commit
c9670473da
10
src/main.py
10
src/main.py
@ -45,6 +45,16 @@ async def generate(
|
||||
)
|
||||
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)
|
||||
|
||||
# Auflösung wählen
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user