'_Context.send() got an unexpected keyword argument 'files'

Im using interactions.py and I cant figure out how to respond with an image

await ctx.send(files="86.png")


Solution 1:[1]

Assuming the file you're trying to send, 86.png, is in the same path as your main file, you should do this:

await ctx.send(file="86.png")

The correct parameter is file, not files.

Solution 2:[2]

files is not supported in interactions.CommandContext due to a decision from the Core Developer team.

However, you can use a 3rd library extension that monkeypatch the CommandContext and add files support. https://github.com/interactions-py/enhanced

You load it in your main bot file: bot.load('interactions.ext.enhanced') After that, you can use files under ctx.send()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 GGberry
Solution 2 JimmyBlue