fyrebirdd
fyrebirdd
DIAdiscord.js - Imagine an app
Created by fyrebirdd on 3/19/2024 in #djs-questions
401 error on get request
they've been the same because ive had this bot running in the past, and i've even put commands on the bot before. For whatever reason it just works now though so idk, maybe i did do something wrong
8 replies
DIAdiscord.js - Imagine an app
Created by fyrebirdd on 3/19/2024 in #djs-questions
401 error on get request
also ignore my horrid touchpad paint job :Hehe:
8 replies
DIAdiscord.js - Imagine an app
Created by fyrebirdd on 3/19/2024 in #djs-questions
401 error on get request
No description
8 replies
DIAdiscord.js - Imagine an app
Created by fyrebirdd on 3/19/2024 in #djs-questions
401 error on get request
yep, they are from the same application in the dev portal
8 replies
DIAdiscord.js - Imagine an app
Created by fyrebirdd on 3/19/2024 in #djs-questions
401 error on get request
ive reset the token twice and it still hasn't worked. I've also made sure the bot is in the guild that im quering. I've even tried it with global commands and it still 401s
8 replies
DIAdiscord.js - Imagine an app
Created by fyrebirdd on 3/19/2024 in #djs-questions
401 error on get request
heres the full code, i just left out the dotenv because i didnt think it was relevant to the issue
import { REST, Routes } from 'discord.js';
import 'dotenv/config.js';


try{
const rest = new REST().setToken(process.env.TEMPLATE_TOKEN);
var data;
data = await rest.get(
Routes.applicationCommands(process.env.TEMPLATE_CLIENT_ID)
);
console.log(data);
}
catch(error){
console.log(error);
}
import { REST, Routes } from 'discord.js';
import 'dotenv/config.js';


try{
const rest = new REST().setToken(process.env.TEMPLATE_TOKEN);
var data;
data = await rest.get(
Routes.applicationCommands(process.env.TEMPLATE_CLIENT_ID)
);
console.log(data);
}
catch(error){
console.log(error);
}
I confirmed it by console logging my whole process.env object before the try catch block and all of the variables in my env file appear in the output
8 replies