Skip to content

Instantly share code, notes, and snippets.

@bustapaladin
Last active March 19, 2024 15:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bustapaladin/36f90c2a7827670f13827fdeefee113c to your computer and use it in GitHub Desktop.
Save bustapaladin/36f90c2a7827670f13827fdeefee113c to your computer and use it in GitHub Desktop.
// 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();
});
@Elm0P2
Copy link

Elm0P2 commented Jun 19, 2016

Wow pro coding 101 John Cena approves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment