-
Notifications
You must be signed in to change notification settings - Fork 0
/
testing.js
51 lines (42 loc) · 1.15 KB
/
testing.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import ReseauDiscordAPI, { ReseauDiscordAPICredentials as Credentials } from "./dist/index.js";
import { USERNAME, TOKEN } from "./credentials.js";
const ID = "820494469262213150";
const rd = new ReseauDiscordAPI();
rd.setCredentials(new Credentials(USERNAME, TOKEN));
console.log(await rd.dbName(), await rd.check(ID));
rd.check(ID)
.then(response => {
console.log("Is blacklisted?", response.blacklist.status);
})
// Handle errors
.catch(error => {
// ...
});
rd.check(ID)
.then(response => {
console.log("Is listed?", response.suspect.status || response.blacklist.status);
})
// Handle errors
.catch(error => {
// ...
});
// Know who added the ID to the list
rd.check(ID)
.then(response => {
if (!response.blacklist.status) return console.log("Not suspect");
console.log("Added as suspect by", response.blacklist.addedBy, "on", response.blacklist.since);
})
// Handle errors
.catch(error => {
// ...
});
rd.remove("suspect", "382869186042658818")
.then(removed => {
// removed will be false if it wasn't on the list
console.log("Removed?", removed);
})
// Handle errors
.catch(error => {
// ...
});
console.log(rd.userAgent);