mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 19:47:00 +03:00
Added usernames to NB Discord webhooks
This commit is contained in:
@@ -106,14 +106,20 @@ function sendWebhooksNB(userID, videoID, UUID, startTime, endTime, category, pro
|
|||||||
//[userID]);
|
//[userID]);
|
||||||
let submissionCount = db.prepare('get', "SELECT COUNT(*) count FROM sponsorTimes WHERE userID=?", [userID]);
|
let submissionCount = db.prepare('get', "SELECT COUNT(*) count FROM sponsorTimes WHERE userID=?", [userID]);
|
||||||
let disregardedCount = db.prepare('get', "SELECT COUNT(*) disregarded FROM sponsorTimes WHERE userID=? and votes <= -2", [userID]);
|
let disregardedCount = db.prepare('get', "SELECT COUNT(*) disregarded FROM sponsorTimes WHERE userID=? and votes <= -2", [userID]);
|
||||||
//let uName = db.prepare('get', "SELECT userName FROM userNames WHERE userID=?", [userID]);
|
let uName = db.prepare('get', "SELECT userName FROM userNames WHERE userID=?", [userID]);
|
||||||
let submittedBy = userID;//"";
|
|
||||||
// If there's no userName then just show the userID
|
let submittedBy = "";
|
||||||
// if (uName.userName == userID){
|
try {
|
||||||
// submittedBy = userID;
|
// If a userName was created then show both
|
||||||
// } else { // else show both
|
if (uName.userName !== userID){
|
||||||
// submittedBy = uName.userName + "\n " + userID;
|
submittedBy = uName.userName + "\n " + userID;
|
||||||
// }
|
} else {
|
||||||
|
submittedBy = userID;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
//Catch in case User is not in userNames table
|
||||||
|
submittedBy = userID;
|
||||||
|
}
|
||||||
|
|
||||||
// Send discord message
|
// Send discord message
|
||||||
if (config.discordNeuralBlockRejectWebhookURL === null) return;
|
if (config.discordNeuralBlockRejectWebhookURL === null) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user