Added another function into DangerCord function file.
This commit is contained in:
@@ -25,7 +25,7 @@ async function dangercordcheckVerification(userId, accessToken) {
|
||||
return 0; // Not allowed to continue
|
||||
} else {
|
||||
return 1; // Allowed to continue
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching user data:', error);
|
||||
@@ -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