EinsteinBot icon indicating copy to clipboard operation
EinsteinBot copied to clipboard

Application Command raised an exception: AttributeError: 'str' object has no attribute 'send'

Open Ednn0nd1au opened this issue 2 years ago • 2 comments

Hi,

after the bot is online and trying to use command /search, from the terminal side there was an error happened:

root@78:/codingProject/EinsteinBot# python3 -u bot.py Bot is online Ignoring exception in on_interaction Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/discord/commands/core.py", line 126, in wrapped ret = await coro(arg) File "/usr/local/lib/python3.8/dist-packages/discord/commands/core.py", line 852, in _invoke await self.callback(self.cog, ctx, **kwargs) File "/codingProject/EinsteinBot/cogs/slashCommands.py", line 32, in search_slash await callCommand(main.Commands.search, self, ctx, urlReal) File "/codingProject/EinsteinBot/core/utils.py", line 45, in callCommand await command(ctx, parameter) File "/usr/local/lib/python3.8/dist-packages/discord/ext/commands/core.py", line 498, in call return await self.callback(context, *args, **kwargs) # type: ignore File "/codingProject/EinsteinBot/cogs/main.py", line 109, in search await sendDefer(ctx, argError, True) File "/codingProject/EinsteinBot/core/utils.py", line 33, in sendDefer await ctx.send(embed=message) AttributeError: 'str' object has no attribute 'send'

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

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 382, in _run_event await coro(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/discord/bot.py", line 1045, in on_interaction await self.process_application_commands(interaction) File "/usr/local/lib/python3.8/dist-packages/discord/bot.py", line 737, in process_application_commands await self.invoke_application_command(ctx) File "/usr/local/lib/python3.8/dist-packages/discord/bot.py", line 997, in invoke_application_command await ctx.command.dispatch_error(ctx, exc) File "/usr/local/lib/python3.8/dist-packages/discord/commands/core.py", line 385, in dispatch_error await injected(cog, ctx, error) File "/usr/local/lib/python3.8/dist-packages/discord/commands/core.py", line 106, in wrapped ret = await coro(*args, **kwargs) File "/codingProject/EinsteinBot/cogs/slashCommands.py", line 44, in search_slash_error raise error File "/usr/local/lib/python3.8/dist-packages/discord/bot.py", line 993, in invoke_application_command await ctx.command.invoke(ctx) File "/usr/local/lib/python3.8/dist-packages/discord/commands/core.py", line 357, in invoke await injected(ctx) File "/usr/local/lib/python3.8/dist-packages/discord/commands/core.py", line 134, in wrapped raise ApplicationCommandInvokeError(exc) from exc discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'str' object has no attribute 'send'

Ednn0nd1au avatar May 21 '22 17:05 Ednn0nd1au

@jckli

Ednn0nd1au avatar May 21 '22 17:05 Ednn0nd1au

After changing answerRaw = await cheinsteinpy.answer(url, self.cookie, self.userAgent) as answerRaw = cheinsteinpy.answer(url, self.cookie, self.userAgent) in main.py

The discord replied with Something went wrong or there was no solution.

Ednn0nd1au avatar May 22 '22 09:05 Ednn0nd1au