Added another function into DangerCord function file.
This commit is contained in:
@@ -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 };
|
||||||
|
|||||||
Reference in New Issue
Block a user