Skip to content

Commit

Permalink
Fix Discord not rendering payload_json
Browse files Browse the repository at this point in the history
It seems Discord no longer renders the `payload_json` if we pass an
empty string filename; we have to completely exclude the filename from
the multipart/form-data header.
  • Loading branch information
Ninjaclasher committed May 28, 2024
1 parent 129a559 commit 181096f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discord_integration/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def message(self, message: Dict[str, Any], full_message: Optional[str] = None) -
files.append(('full_message.txt', full_message, 'text/plain'))

data = {
'payload_json': ('', json.dumps(message), 'application/json'),
'payload_json': (None, json.dumps(message), 'application/json'),
}
for i, file in enumerate(files):
data['files[{}]'.format(i)] = file
Expand Down

0 comments on commit 181096f

Please sign in to comment.