RealDevMashup
RealDevMashup

Reputation: 81

Getting discord access token[Discord.js]

Im still trying to authorize my discord bot with my website with this guide but i dont really understand how to get the access token.

My code

const http = require('http');
const fs = require('fs');
const port = 53134;

http.createServer((req, res) => {
	let responseCode = 404;
	let content = '404 Error';

	if (req.url === '/') {
		responseCode = 200;
		content = fs.readFileSync('../HTML/index.html');
	}

	res.writeHead(responseCode, {
		'content-type': 'text/html;charset=utf-8',
	});

	res.write(content);
	res.end();
})
	.listen(port);

everytime I run this i get the'404 error' and I feel like its because of the missing access token

Upvotes: 0

Views: 630

Answers (1)

CandyCZ01
CandyCZ01

Reputation: 26

Error 404 = Not Found The requested URL was not found on this server.

Error 403 = Forbidden You don't have permission to access this resource.

So if you are missing access token the error would be 403, not 404.

Upvotes: 1

Related Questions