Added another function into DangerCord function file.

This commit is contained in:
Nahokey
2024-04-28 18:55:18 +00:00
parent ee5960ddc1
commit 483875609b
+18 -1
View File
@@ -33,4 +33,21 @@ async function dangercordcheckVerification(userId, accessToken) {
} }
} }
module.exports = { dangercordcheckVerification }; async function dangercordcheckInfo(userId, accessToken) {
const url = `https://dangercord.com/api/v1/user/${userId}`;
const headers = {
'Authorization': `Bearer ${cfg.dangerCordAPIKey}`
};
try {
const response = await fetch(url, { headers });
const userData = await response.json();
return userData;
} catch (error) {
console.error('Error fetching user data:', error);
return;
}
}
module.exports = { dangercordcheckVerification, dangercordcheckInfo };