I tried triggering a Slash Command using requests, but I have came around an error I have no clue how to fix.
Code:
import requests
payload = {
"type": 2,
"application_id": "999736048596816014",
"guild_id": "1190781950944886867",
"channel_id": "1190781950944886870",
"session_id": "4d8f14035632b07e98830b5a9706e1d6",
"data": {
"version": "1171521015759769721",
"id": "1001775070169022494",
"name": "about",
"application_command": {
"id": "1001775070169022494",
"application_id": "999736048596816014",
},
},
}
headers = {
"Authorization": "my token here",
"content-type": "application/json"
}
r = requests.post("https://discord.com/api/v9/interactions", json=payload, headers=headers)
print(r.text)
Error:
{"message": "Invalid Form Body", "code": 50035, "errors": {"data": {"_errors": [{"code": "INTERACTION_APPLICATION_COMMAND_INVALID", "message": "Invalid interaction application command"}]}}}
I tried using a full payload copied from the Networking Tab on the Developer Console, but I was still getting the same error.
If anyone could help me It would mean a lot to me. Thanks in advance!