discord-php / DiscordPHP

An API to interact with the popular messaging app Discord
MIT License
975 stars 236 forks source link

Error MODEL_TYPE_CONVERT #1196

Closed danielabyan closed 6 months ago

danielabyan commented 6 months ago

Hi. Discord worked for me without any problems. But this week my bot stopped working because of this error. I didn't change anything on my server, so I think this bug is due to external triggers. Here is the error message.

[2024-01-13T19:58:13.849407+00:00] DiscordPHP.WARNING: REQ POST interactions/..../callback failed: Discord\Http\Exceptions\RequestFailedException: Bad Request - 
{
    "message": "Invalid Form Body",     
    "code": 50035,     
    "errors": {         
        "data": {             
            "_errors": [                 
                {                     
                    "code": "MODEL_TYPE_CONVERT",                     
                    "message": "Expected an object\/dictionary."                 
                }             
            ]         
        }     
    } 
} in /var/www/vendor/discord-php/http/src/Discord/Http.php:500 Stack trace: 

Here's my code.

// Error occurs after this line
$interaction->acknowledgeWithResponse()->done(function () use ($interaction, $context) {
    // the error occurs before this callback is entered.
});

Package version 7.3.

What can I do to fix this bug. Thank you?

key2peace commented 6 months ago

just released an update that should fix this, feel free to composer update

danielabyan commented 6 months ago

@key2peace Thank you 🙏