Last active
March 19, 2024 15:32
-
-
Save bustapaladin/36f90c2a7827670f13827fdeefee113c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// edit as you wish, all credit goes to @Bernkastel from Discord and @Elm0P2 on here for making this bot! | |
// for api documentation see: https://cointrust.pw/api/ | |
engine.on('msg', function(msg) { | |
var regex = /!cointrust (.*)/i | |
var match = msg.message.match(regex); | |
if (!match) return; | |
var xhttp = new XMLHttpRequest(); | |
xhttp.onreadystatechange = function(){ | |
if(xhttp.readyState === 4 && xhttp.status === 200){ | |
data = JSON.parse(xhttp.responseText); | |
console.log(data); | |
console.log(data.id); | |
if(data == "" || data == null || data == undefined) { engine.chat("User "+match[1]+" doesn't exist on Cointrust.pw!"); return; } | |
if(data.scammed_users !== "" && data.scammed_users !== null && data.scammed_users !== undefined) { engine.chat("About "+match[1]+" | Profile summary: "+data[0].profile_summary+" | Bustabit reputation: "+data[0].bustabit_rep+" | Bustabit usernames: "+data[0].bustabit_names+" | Users scammed: "+data[0].scammed_users+" | Moneypot usernames: "+data[0].moneypot_names+" | Skype usernames: "+data[0].skype_names+" | You can find more about this user here: https://cointrust.pw/profile/"+match[1]); return; } | |
engine.chat("About "+match[1]+" | Profile summary: "+data[0].profile_summary+" | Bustabit reputation: "+data[0].bustabit_rep+" | Bustabit usernames: "+data[0].bustabit_names+" | BTC lost total: "+data[0].btc_lost_total+" | Moneypot usernames: "+data[0].moneypot_names+" | Skype usernames: "+data[0].skype_names+" | You can find more about this user here: https://cointrust.pw/profile/"+match[1]); | |
} | |
} | |
xhttp.open("GET", "https://cointrust.pw/wp-json/wp/v2/profile?slug="+match[1], true); | |
xhttp.send(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wow pro coding 101 John Cena approves