fix test function IV
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -6,3 +6,6 @@ node_modules
|
||||
dist
|
||||
.env
|
||||
.env.*
|
||||
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
@@ -1,22 +1,13 @@
|
||||
const axios = require('axios');
|
||||
|
||||
exports.handler = async function(event, context) {
|
||||
axios
|
||||
.get(`https://discord.com/api/v9/users/@me`, {
|
||||
let response = await axios.get(`https://discord.com/api/v9/users/@me`, {
|
||||
headers: {
|
||||
Authorization: `Bot ${process.env.token}`,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
});
|
||||
return {
|
||||
statusCode: 200,
|
||||
body: JSON.stringify(response.data),
|
||||
};
|
||||
})
|
||||
.catch((error) => {
|
||||
return {
|
||||
statusCode: 500,
|
||||
body: JSON.stringify({ errorMsg: 'discord api shat itself brb' }),
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user