I already found this post: https://www.reddit.com/r/discordapp/comments/83itgm/does_anyone_know_how_to_send_embeds_from_php_to_a/
But I'm trying to send a attachment/a csv file. Someone have an idea how it works?
API-Description: https://discord.com/developers/docs/resources/webhook#execute-webhook
But I dont know how to solve it. I'm able to send messages with embeds and fields and stuff, but I dont know how the json should look. Current json which I'm sending.
Array
(
[content] =>
[embeds] => Array
(
[0] => Array
(
[title] => Title
[color] => 65300
[url] => /var/www/html/includes/discord/CSV_from_2021-05-27_00-00-00_to_2021-05-27_23-59-59.csv
[description] => Desc
)
)
[file] => /var/www/html/includes/discord/CSV_from_2021-05-27_00-00-00_to_2021-05-27_23-59-59.csv
)
And I also change the header from application/json to multipart/form-data when sending by using php.
How does the correct json look?
source https://stackoverflow.com/questions/67744842/discord-webhook-attachment-json
Comments
Post a Comment