diff --git a/app/bot.py b/app/bot.py index 0613c961..5468bb03 100755 --- a/app/bot.py +++ b/app/bot.py @@ -213,7 +213,12 @@ async def on_message(ctx): response = requests.post(url, json=payload, headers=headers) answer = response.json()["choices"][0]["message"]["content"] - await ctx.reply(answer.replace("<|end_of_turn|>", "")) + + if len(answer) > 2000: + await ctx.reply(answer[:2000].replace("<|end_of_turn|>", "")) + await ctx.reply(answer[2000:].replace("<|end_of_turn|>", "")) + else: + await ctx.reply(answer.replace("<|end_of_turn|>", "")) bot.run(os.getenv("discord_token"))