pycord icon indicating copy to clipboard operation
pycord copied to clipboard

ctx.respond can't send file

Open Miolus opened this issue 5 years ago • 3 comments

Summary

Trying to send a file (e.g. image) with ctx.respond ends up in TypeError: send_message() got an unexpected keyword argument 'file'.

Reproduction Steps

Try to send a file with ctx.respond

Minimal Reproducible Code

ctx.respond(embed=embed, file=my_file_variable)

Expected Results

Send the file

Actual Results

Ignoring exception in command <discord.app.commands.SlashCommand name=graph>: Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/discord/app/commands.py", line 85, in wrapped ret = await coro(arg) File "/usr/local/lib/python3.9/dist-packages/discord/app/commands.py", line 445, in _invoke await self.callback(self.cog, ctx, **kwargs) File "/root/invitechecker/test/engine/sl_pub_func.py", line 72, in visualize_data await ctx.respond(embed=em, file=file) TypeError: send_message() got an unexpected keyword argument 'file'

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

Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/discord/bot.py", line 227, in process_application_commands await ctx.command.invoke(ctx) File "/usr/local/lib/python3.9/dist-packages/discord/app/commands.py", line 135, in invoke await injected(ctx) File "/usr/local/lib/python3.9/dist-packages/discord/app/commands.py", line 91, in wrapped raise ApplicationCommandInvokeError(exc) from exc discord.app.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: send_message() got an unexpected keyword argument 'file'

Intents

members

System Information

Python 3.9.4

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shown the entire traceback, if possible.
  • [X] I have removed my token from display, if visible.

Additional Context

Using slash branch.

Miolus avatar Oct 17 '21 10:10 Miolus

Files have been done in #263, master branch

Dorukyum avatar Oct 17 '21 10:10 Dorukyum

Will this be inclued in slash branch soon or are these different ?

Miolus avatar Oct 17 '21 16:10 Miolus

Yes.

izxxr avatar Oct 17 '21 16:10 izxxr