const { DRepClient } = require('@drep/api');
const drep = new DRepClient('D-REP.YOUR-KEY');
class DRepClient {
rep(userID: string): Reputation;
infractions(userID: string): Ban | Warn | null;
}
interface Reputation {
upvotes: number;
downvotes: number;
reputation: number;
rank: string;
xp: number;
staff: boolean;
}
interface Ban {
moderator: string;
reason: string;
date: Date;
}
interface Warn {
moderator: string;
reason: string;
date: Date;
}
Full example of getting reputation
const { DRepClient } = require('@drep/api');
const drep = new DRepClient('D-REP.YOUR-KEY');
let getReputation = async (userID) => {
let rep = await drep.rep(userID);
console.log(rep);
}
getReputation('1234567891234567');