https://github.com/artivain/reseau-discord-node
Node.js module for interacting with the Réseau Discord Artivain API.
https://github.com/artivain/reseau-discord-node
api axios blacklist discord discord-api discord-bot free security sus
Last synced: 6 months ago
JSON representation
Node.js module for interacting with the Réseau Discord Artivain API.
- Host: GitHub
- URL: https://github.com/artivain/reseau-discord-node
- Owner: Artivain
- License: mit
- Created: 2022-07-14T15:35:09.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-08T20:15:21.000Z (over 2 years ago)
- Last Synced: 2025-03-25T05:51:21.369Z (6 months ago)
- Topics: api, axios, blacklist, discord, discord-api, discord-bot, free, security, sus
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/reseau-discord
- Size: 320 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reseau-discord-node
[](https://wakatime.com/badge/github/Artivain/reseau-discord-node)
[](https://www.codefactor.io/repository/github/artivain/reseau-discord-node)
[](https://www.npmjs.com/package/reseau-discord)


[](https://axios-http.com/)
[](https://discord.artivain.com)Node.js module for interacting with the Réseau Discord Artivain API.
## How to use
Create a new connection to an APIBy default, it uses the official database from Artivain but it can be changed to any database compatible with the Réseau Discord API.
```js
// Import the library
import ReseauDiscordAPI, { ReseauDiscordAPICredentials } from "reseau-discord";// Create a new connection
const rd = new ReseauDiscordAPI();// Optional: use a third-party database compatible with the API
rd.setBaseUrl("https://anotherdatabase.tld");// You can also directly set the base URL when initializing the ReseauDiscordAPI
const alternativeDatabase = new ReseauDiscordAPI("https://anotherdatabase.tld");// Optional: set authentication credentials to use endpoints that requires permissions
const USERNAME = "username";
const TOKEN = "supersecrettoken";
rd.setCredentials(new ReseauDiscordAPICredentials(USERNAME, TOKEN));// Check if an ID is suspect
rd.check("382869186042658818")
.then(response => {
console.log("Is suspect?", response.suspect.status);
})
// Handle errors
.catch(error => {
// ...
});// Check if an ID is blacklisted
rd.check("382869186042658818")
.then(response => {
console.log("Is blacklisted?", response.blacklist.status);
})
// Handle errors
.catch(error => {
// ...
});// Check if an ID is listed on at least one list
rd.check("382869186042658818")
.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("382869186042658818")
.then(response => {
if (!response.suspect.status) return console.log("Not suspect");// Log the username and timestamp
console.log("Added as suspect by", response.suspect.addedBy, "on", response.suspect.since);
})
// Handle errors
.catch(error => {
// ...
});// Add an ID to a list
// Don't forget to set the credentials first!
rd.add("suspect", "382869186042658818")
.then(added => {
// added will be false if it was already on the list
console.log("Added?", added);
})
.catch(error => {
// ...
});// Remove an ID from the list
// Don't forget to set the credentials first!
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 => {
// ...
});
```