xNul / chat-llama-discord-bot

A Discord Bot for chatting with LLaMA, Vicuna, Alpaca, MPT, or any other Large Language Model (LLM) supported by text-generation-webui or llama.cpp.
https://discord.gg/TcRGDV754Y
MIT License
118 stars 23 forks source link

Running into discord embed limit of 1024. #3

Closed keninishna closed 1 year ago

keninishna commented 1 year ago

I am running into this error occasionally when the bot writes a lot of text. There should be a way to either limit the output to max or create a new message when max is reached.

Traceback (most recent call last): File "C:\Users\John\miniconda3\envs\textgen\lib\site-packages\discord\app_commands\commands.py", line 842, in _do_call return await self._callback(interaction, **params) # type: ignore File "C:\Users\John\Downloads\one-click-installers-oobabooga-windows\text-generation-webui\bot.py", line 173, in reply await ll_gen(ctx, queues) File "C:\Users\John\Downloads\one-click-installers-oobabooga-windows\text-generation-webui\bot.py", line 116, in ll_gen await msg.edit(embed=replyembed) File "C:\Users\John\miniconda3\envs\textgen\lib\site-packages\discord\webhook\async.py", line 841, in edit return await self._state._webhook.editmessage( File "C:\Users\John\miniconda3\envs\textgen\lib\site-packages\discord\webhook\async.py", line 1974, in edit_message data = await adapter.edit_webhookmessage( File "C:\Users\John\miniconda3\envs\textgen\lib\site-packages\discord\webhook\async.py", line 221, in request raise HTTPException(response, data) discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In embeds.0.fields.1.value: Must be 1024 or fewer in length.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\John\miniconda3\envs\textgen\lib\site-packages\discord\ext\commands\hybrid.py", line 438, in _invoke_with_namespace value = await self._do_call(ctx, ctx.kwargs) # type: ignore File "C:\Users\John\miniconda3\envs\textgen\lib\site-packages\discord\app_commands\commands.py", line 860, in _do_call raise CommandInvokeError(self, e) from e discord.app_commands.errors.CommandInvokeError: Command 'reply' raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In embeds.0.fields.1.value: Must be 1024 or fewer in length.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\John\miniconda3\envs\textgen\lib\site-packages\discord\ext\commands\hybrid.py", line 438, in _invoke_with_namespace value = await self._do_call(ctx, ctx.kwargs) # type: ignore File "C:\Users\John\miniconda3\envs\textgen\lib\site-packages\discord\app_commands\commands.py", line 860, in _do_call raise CommandInvokeError(self, e) from e discord.ext.commands.errors.HybridCommandError: Hybrid command raised an error: Command 'reply' raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In embeds.0.fields.1.value: Must be 1024 or fewer in length.

xNul commented 1 year ago

@keninishna I was able to reproduce and it should be fixed now. Thanks for the issue!