🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

nyxr

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nyxr - npm Package Compare versions

Comparing version

to
1.0.4

4

package.json
{
"name": "nyxr",
"version": "1.0.3",
"description": "An API for disxord bots site",
"version": "1.0.4",
"description": "An API for discord bots site",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -1,12 +0,8 @@

# dblapi.js
An official module for interacting with the discordbots.org API
# nyxr
An official module for interacting with the discordbots.site API
## Installation
`npm install dblapi.js`
`npm install nyxr`
## Documentation
Documentation can be found [here](https://discordbots.org/api/docs#jslib)
## Example
## NOTE:
- The api is still WIP (work in progress).
### Example of posting server count with supported libraries (Discord.js and Eris)

@@ -16,25 +12,12 @@ ```js

const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
// Optional events
dbl.on('posted', () => {
const DBS = require("nyxr");
const dbs = new DBS('Your discordbots.site token', client);
//Optional events
dbs.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
dbs.on('error', e => {
console.log(`Oops! ${e}`);
})
```
### Example of using webhooks to receive vote updates
```js
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
```