discord-user-bots
Version:
A library that allows you to use the full potential of Discords API to create and operate powerful user bots
37 lines (32 loc) • 808 B
JavaScript
/**
*
* ## OVERVIEW
*
* A class for handling Discord's fingerprint system.
*
*/
class Fingerprint {
constructor(requester) {
this.requester = requester;
this.fingerprint = undefined;
this.fingerprintID = undefined;
}
async request() {
const info = await this.requester.fetch_request_insecure(
"experiments",
undefined,
undefined,
"GET"
);
this.fingerprint = info.fingerprint;
return this.fingerprint;
}
get id() {
if (this.fingerprint === undefined) return undefined;
if (this.fingerprintID === undefined) {
this.fingerprintID = this.fingerprint.split(".")[0];
}
return this.fingerprintID;
}
}
module.exports = Fingerprint;