Closed Mabi19 closed 3 years ago
Thank you very, very much for your very clear report.
jsonifyMessage is meant to be used for creating a payload for both, sending and editing messages, that's why it tries to put in the attachments
field into the payload (https://discord.com/developers/docs/resources/channel#edit-message)
The issue was, that in the overriden send
function, it takes **kwargs
and the function passes them over to the jsonifyMessage
function. If you use the file
or files
kwarg, the send function will pass them to the jsonifyMessage
function, but jsonifyMessage doesn't take params with the name file
or files
.
When overridden,
ctx.send
does raises an exception if you pass in afile
orfiles
kwarg, while the regular discord.pyctx.send
does not. After peeking at the source, it seems that thejsonifyMessage
function wants thediscord.Attachment
class - which is the class for an attachment on an already existing message. It also tries to put it in theattachments
field of thepayload
object, which the Discord API does not support (according to https://discord.com/developers/docs/resources/channel#create-message-jsonform-params)