DiscordRep API
Back to DiscordRep
API status
Search…
DiscordRep API V3
API examples
Powered By
GitBook
API examples
Node.js example
using @drep/api
$
npm
install
@drep/api
Usage
const
{
DRepClient
}
=
require
(
'@drep/api'
);
const
drep
=
new
DRepClient
(
'D-REP.YOUR-KEY'
);
Endpoints
class
DRepClient
{
rep
(
userID
:
string
)
:
Reputation
;
infractions
(
userID
:
string
)
:
Ban
|
Warn
|
null
;
}
Return Types
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'
);
Previous
DiscordRep API V3
Last modified
2yr ago
Copy link
Outline
Node.js example