Sopur / Discord-user-bots

Working discord user bots library.
MIT License
81 stars 35 forks source link

Can't Accept Friend Requests #38

Closed Pig0Brine closed 2 months ago

Pig0Brine commented 1 year ago

When trying to accept friend requests, I get this error: { code: 50109, message: 'The request body contains invalid JSON.' }

Sopur commented 1 year ago

What is the code you're using to accept friend requests?

Pig0Brine commented 1 year ago

This:

// Auto Accept Friend Requests
client.on.relationship_add = async function(relationship) {
    // console.log(relationship);

    if (relationship.type === 3) {
        await delay(5000);

        console.log(`Added ${relationship.user.username}#${relationship.user.discriminator} as a friend!`);
        console.log(await client.accept_friend_request(relationship.id));
    }
}
Sopur commented 2 months ago

This problem was fixed in DUB version 2.0.0.