mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
fix(makeprompt.py): fix issue where long response content is not fully sent in chatgpt_process function
The issue was that when the response content was longer than 2000 characters, it was not being fully sent in the chatgpt_process function. This was fixed by adding a loop to send the content in chunks of 2000 characters until the entire content is sent.
This commit is contained in:
@@ -169,6 +169,14 @@ async def chatgpt_process(
|
||||
"The function call is empty. Please retry.", delete_after=10
|
||||
)
|
||||
else:
|
||||
content = response.get("content", "")
|
||||
while len(content) != 0:
|
||||
if len(content) > 2000:
|
||||
await message.channel.send(content[:2000])
|
||||
content = content[2000:]
|
||||
else:
|
||||
await message.channel.send(content)
|
||||
content = ""
|
||||
await message.channel.send(response["content"]) # type: ignore
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user