Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ednn0nd1au opened this issue May 21, 2022 · 2 comments

Comments

@Ednn0nd1au
Copy link

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
Copy link
Author

@jckli

@Ednn0nd1au
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant