client.fetchInvite() returns 'Unknown Invite' for valid friend invite links

Hello, I'm using client.fetchInvite() and passing the friend request code to it. However, when I execute it, I get an "Unknown Invite" error. Although when I make the request in a browser or send the link in Discord, it's clear that the link is valid. What could this be related to?
No description
5 Replies
d.js toolkit
d.js toolkit2mo ago
monbrey
monbrey2mo ago
Dunno what to tell you - this is a Discord API error so its rejecting your request to fetch it Might need to ask ddevs
Inky
Inky2mo ago
client.fetchInvite is for fetching guild invites like to join a server, not friend codes Bots don’t have friends, so they have no apis for that sort of thing
Enju
EnjuOP2mo ago
Oh, it's just that with the link to join the DM group everything worked correctly and I thought that maybe I was doing something wrong. Thanks!
d.js toolkit
d.js toolkit2mo ago
The thread owner has marked this issue as solved.

Did you find this page helpful?