© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
discord.js - Imagine ❄d-I❄
discord.js - Imagine ❄•4y ago•
13 replies
Mulo

Oauth2 bot reply

Im stuck if somebody can help:
I got the info from the Oauth2, but now im lost as to how to send back a dm to the user
fetch('https://discordapp.com/api/v6/users/@me', {
  method: 'GET',
   headers: { 'Authorization': `Bearer ${json.access_token}` }
}).then(response => response.json()).then(resp => {MakeappThread(resp.id)})
fetch('https://discordapp.com/api/v6/users/@me', {
  method: 'GET',
   headers: { 'Authorization': `Bearer ${json.access_token}` }
}).then(response => response.json()).then(resp => {MakeappThread(resp.id)})

the above is fine, im getting the info.
this the function that supposed to put the bot instance on
function MakeappThread(UID, servers){

client.on('ready', async () => {
    
    const user = client.users.cache.get(UID);
    user.send("HELLO")

});
}
function MakeappThread(UID, servers){

client.on('ready', async () => {
    
    const user = client.users.cache.get(UID);
    user.send("HELLO")

});
}

the function is firing, the client doesnt go on
discord.js - Imagine ❄ banner
discord.js - Imagine ❄Join
Support server for discord.js, a Node.js module to interact with Discord's apps API.
57,915Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

OAuth2 URL + Bot Permissions + Discord Intents
discord.js - Imagine ❄d-I❄discord.js - Imagine ❄ / djs-questions
2y ago
Passing metadata from bot OAuth2 Invite link?
discord.js - Imagine ❄d-I❄discord.js - Imagine ❄ / djs-questions
4y ago