Reputation: 23
I'm trying to automate clicking on discord buttons using requests and python, but i have an error when i send the request.
I tried this :
header = {
'authorization' : 'XXX'
}
data = {
"type": 3,
"guild_id": "XXX",
"channel_id": "XXX",
"message_id": message['id'],
"application_id": "XXX",
"data": {
"component_type": 2,
"custom_id": message['components'][0]['components'][1]['custom_id']
}
}
try:
r = requests.post('https://discord.com/api/v9/interactions', data = data, headers = header)
But the program gives me that at the end :
{"code": 50035, "errors": {"data": {"_errors": [{"code": "MODEL_FROM_NON_DICTLIKE", "message": "Models can only be instantiated from something dict-like, got <class 'str'>"}]}}, "message": "Invalid Form Body"}
If you have any ideas to help me I am interested. Thanks.
Upvotes: 2
Views: 3807