Coder Social home page Coder Social logo

Comments (11)

plon avatar plon commented on May 27, 2024 1

Done.

from bard-discord-bot.

revblueldd avatar revblueldd commented on May 27, 2024

I suspect it might be related to the formatting used on text in the chat prompt - notice the "queen - obscene" part.

I was able to get it to fail with "/chat what about this?"

from bard-discord-bot.

revblueldd avatar revblueldd commented on May 27, 2024

Interestingly an asterisk works as a math operator like with "/chat what is 4 * 2?" but does not when you use a pair of them to format the text between them.

from bard-discord-bot.

plon avatar plon commented on May 27, 2024

Can you paste the text that you are inputting here?

from bard-discord-bot.

revblueldd avatar revblueldd commented on May 27, 2024

I did in my example "/chat what about this?" but this interface is also applying the style so you can't see it. The word "this" is surrounded by asterisks in my example.

from bard-discord-bot.

plon avatar plon commented on May 27, 2024

That's odd. It works for me.
Screenshot 2023-05-18 at 8 56 35 PM

from bard-discord-bot.

revblueldd avatar revblueldd commented on May 27, 2024

After the latest git pull it is now working for me as well.

from bard-discord-bot.

revblueldd avatar revblueldd commented on May 27, 2024

I just got this exception again. I have no clue what might be causing it.

Screenshot 2023-05-18 214945

[2023-05-18 21:47:03] [ERROR ] discord.app_commands.tree: Ignoring exception in command 'chat'
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\app_commands\commands.py", line 842, in _do_call
return await self._callback(interaction, **params) # type: ignore
File "C:\Bard-Discord-bot\main.py", line 148, in chat
await interaction.channel.send(chunk)
File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\abc.py", line 1561, in send
data = await state.http.send_message(channel.id, params=params)
File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\http.py", line 744, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message

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

Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\app_commands\tree.py", line 1248, in _call
await command._invoke_with_namespace(interaction, namespace)
File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\app_commands\commands.py", line 867, in _invoke_with_namespace
return await self._do_call(interaction, transformed_values)
File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\app_commands\commands.py", line 860, in _do_call
raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'chat' raised an exception: HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message

from bard-discord-bot.

revblueldd avatar revblueldd commented on May 27, 2024

The user above reposted the same /chat as in the screenshot afterwards, and it worked that time. I cannot pin down any reason why it is intermittent like that.

The only people who were trying this at this time were myself and one other (and not simultaneously), so I do not think that concurrency is the issue.

Right after it worked again, it then failed twice and worked the 3rd time after a reset. The reset may have helped but am not confident of that. This may well be an issue with the projects this is based on and nothing you can do about that part, other than perhaps some error handling to display a graceful message when the call fails.

Screenshot 2023-05-18 215921

from bard-discord-bot.

plon avatar plon commented on May 27, 2024

This is most likely an issue with the reversed Bard API that the bot uses.

from bard-discord-bot.

revblueldd avatar revblueldd commented on May 27, 2024

I agree - perhaps could put a generic error similar to the other one, when the call fails?

from bard-discord-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.