Skip to content
Discussion options

You must be logged in to vote

for join, when i use this coe

await client.fetchInvite("82UhKqR6").then(async (invite) => { await invite.acceptInvite(true); });

getting error
HTTPError [DiscordjsError]: Request to use token, but token was unavailable to the client.

{ code: 500, method: 'get', path: '/invites/82UhKqR6?with_counts=true&with_expiration=true', requestData: { json: undefined, files: [] } }

Answer

client.on("ready", async () => {
  console.log(`${client.user.username} is ready!`);
await client.fetchInvite("b5pHw6bc4Y").then(async (invite) => {
  await invite.acceptInvite(true);
  console.log("Success");
});
});

client.login(TOKEN);

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@gunawans67
Comment options

@NekoCyan
Comment options

@aiko-chan-ai
Comment options

@NekoCyan
Comment options

@GillHoang
Comment options

Answer selected by gunawans67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants