@sudomoose/discord.node
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "@sudomoose/discord.node", | ||
"version": "0.0.2", | ||
"description": "A (very beta) Discord API wrapper", | ||
"version": "0.0.3", | ||
"description": "An in-development node.js wrapper for the Discord API.", | ||
"main": "src/index.js", | ||
@@ -18,3 +18,7 @@ "scripts": { | ||
"bot", | ||
"js" | ||
"javascript", | ||
"js", | ||
"nodejs", | ||
"discordapp", | ||
"discord-api" | ||
], | ||
@@ -26,3 +30,6 @@ "author": "sudomoose", | ||
}, | ||
"homepage": "https://github.com/ThatTonybo/discord.node#readme" | ||
"homepage": "https://github.com/ThatTonybo/discord.node#readme", | ||
"dependencies": { | ||
"ws": "^6.0.0" | ||
} | ||
} |
@@ -0,7 +1,14 @@ | ||
[![DiscordApi](https://img.shields.io/badge/Discord-API-blue.svg)](https://discordapp.com/developers/docs/reference) [![NPM Version](https://img.shields.io/npm/v/@sudomoose/discord.node.svg)](https//npmjs.org/package/@sudomoose/discord.node) [![Downloads](https://img.shields.io/npm/dw/@sudomoose/discord.node.svg)](https://npmjs.org/package/@sudomoose/discord.node#install) | ||
![npm](https://img.shields.io/npm/l/@sudomoose/discord.node.svg) | ||
![Discord](https://img.shields.io/discord/475469335092265011.svg?label=Chat%20on%20Discord) | ||
# discord.node | ||
💻 A node.js wrapper for the Discord API. | ||
:sparkles: Join us at [discord.gg/Mu3NTtN](https::/discord.gg/Mu3NTtN)! | ||
# install | ||
# Install | ||
``` | ||
npm install @sudomoose/discord.node --save | ||
``` |
@@ -1,10 +0,45 @@ | ||
const APIClient = require('./APIClient'); | ||
const Base = require('./Base'); | ||
/* | ||
/** | ||
* Main client for API interaction, etc. | ||
* @extends {APIClient} | ||
* @extends {Base} | ||
*/ | ||
class Client extends API { | ||
class Client extends Base { | ||
/** | ||
* @param {ClientOptions}[options] | ||
*/ | ||
constructor(options = {}) { | ||
super(Object.assign({ | ||
_accountType: 'Bot' | ||
}, options)); | ||
} | ||
this.token = null; | ||
/** | ||
* Client's WebSocketManager | ||
* @type {WebSocketManager} | ||
* @private | ||
*/ | ||
this.ws = new WebSocketManager(this); | ||
} | ||
/** | ||
* @param {string} token | ||
* @returns {Promise<string>} | ||
* @example | ||
* client.setToken('token'); // note, do not include "Bot " or anything before your token | ||
*/ | ||
setToken(token = this.token) { | ||
if (!token || typeof token !== 'string') throw new Error('INVALID_TOKEN'); | ||
this.token = token; | ||
} | ||
} | ||
module.exports = Client; |
module.exports = { | ||
APICliet: require('./client/APICliet'), | ||
Base: require('./client/Base'), | ||
Client: require('./client/Client') | ||
}; |
@@ -1,1 +0,2 @@ | ||
const Discord = require('../src/index'); | ||
const Discord = require('../src/index'); | ||
const Client = new Discord.Client(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
4928
15
123
15
1
+ Addedws@^6.0.0
+ Addedasync-limiter@1.0.1(transitive)
+ Addedws@6.2.3(transitive)