You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library is no longer working, at least not to me. Correct me if I'm wrong.
I've created a ChatBot for my and a group of closer friends, but a few days back it suddenly stopped working prompting this error: 400 Bad Request (error code: 50006): Cannot send an empty message. It is a Discord bot, so I'm going to leave here the code that was working until a few days as I mentioned.
classGenerateResponse(commands.Cog):
def__init__(self, bot):
self.bot=botself.cookie=settings.COOKIEself.claude=Claude(self.cookie)
@commands.Cog.listener()asyncdefon_message(self, message: discord.Message):
ifmessage.author==self.bot.user:
returnif"claude"inmessage.content.lower():
prompt=message.contentasyncwithmessage.channel.typing():
try:
response=self.generate_response(prompt)
awaitmessage.channel.send(response)
exceptExceptionase:
awaitmessage.channel.send(f"Ocurrió un error al generar la respuesta: {e}")
defgenerate_response(self, prompt):
try:
response=self.claude.get_answer(prompt)
returnresponseexceptExceptionase:
returnf"Ocurrió un error: {e}"@commands.command()asyncdefnew(self, ctx):
self.claude.create_new_conversation()
awaitctx.send('Listo')
asyncdefsetup(bot):
awaitbot.add_cog(GenerateResponse(bot))
This is the Cog Class that is called when a new response is generated. After this, I tried the example code to see if it was a problem of mine and it print nothing but an empty line, and also in the Claude Chat no message is send.
The text was updated successfully, but these errors were encountered:
The library is no longer working, at least not to me. Correct me if I'm wrong.
I've created a ChatBot for my and a group of closer friends, but a few days back it suddenly stopped working prompting this error:
400 Bad Request (error code: 50006): Cannot send an empty message
. It is a Discord bot, so I'm going to leave here the code that was working until a few days as I mentioned.This is the Cog Class that is called when a new response is generated. After this, I tried the example code to see if it was a problem of mine and it print nothing but an empty line, and also in the Claude Chat no message is send.
The text was updated successfully, but these errors were encountered: