snowtransfer
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -5,3 +5,31 @@ { | ||
"SnowTransfer": [ | ||
"./src/**/*.js" | ||
"./src/**/*.js", | ||
"!./src/methods/**/*.js" | ||
], | ||
"AuditLog": [ | ||
"./src/methods/AuditLog.js" | ||
], | ||
"Bots": [ | ||
"./src/methods/Bots.js" | ||
], | ||
"Channels": [ | ||
"./src/methods/Channels.js" | ||
], | ||
"Emojis": [ | ||
"./src/methods/Emojis.js" | ||
], | ||
"Guilds": [ | ||
"./src/methods/Guilds.js" | ||
], | ||
"Invites": [ | ||
"./src/methods/Invites.js" | ||
], | ||
"Users": [ | ||
"./src/methods/Users.js" | ||
], | ||
"Voices": [ | ||
"./src/methods/Voices.js" | ||
], | ||
"Webhooks": [ | ||
"./src/methods/Webhooks.js" | ||
] | ||
@@ -47,3 +75,51 @@ }, | ||
"label": "Documentation", | ||
"href": "?api=SnowTransfer#SnowTransfer" | ||
"iconClass": "ico ico-book", | ||
"items": [ | ||
{ | ||
"label": "Client", | ||
"href": "?api=SnowTransfer" | ||
}, | ||
{ | ||
"label": "AuditLog", | ||
"href": "?api=AuditLog" | ||
}, | ||
{ | ||
"label": "Bots", | ||
"href": "?api=Bots" | ||
}, | ||
{ | ||
"label": "Channels", | ||
"href": "?api=Channels" | ||
}, | ||
{ | ||
"label": "Emojis", | ||
"href": "?api=Emojis" | ||
}, | ||
{ | ||
"label": "Guilds", | ||
"href": "?api=Guilds" | ||
}, | ||
{ | ||
"label": "Invites", | ||
"href": "?api=Invites" | ||
}, | ||
{ | ||
"label": "Users", | ||
"href": "?api=Users" | ||
}, | ||
{ | ||
"label": "Voices", | ||
"href": "?api=Voices" | ||
}, | ||
{ | ||
"label": "Webhooks", | ||
"href": "?api=Webhooks" | ||
} | ||
] | ||
}, | ||
{ | ||
"label": "GitHub", | ||
"href": "https://github.com/DasWolke/SnowTransfer", | ||
"target": "_blank", | ||
"iconClass": "ico-md ico-github" | ||
} | ||
@@ -53,2 +129,2 @@ ] | ||
} | ||
} | ||
} |
@@ -5,3 +5,3 @@ let SnowTransfer = require('../src/SnowTransfer'); | ||
let request = async () => { | ||
let message = await client.channel.createMessage('312298984964227072', { | ||
let message = await client.channel.createMessage('your channel id here', { | ||
embed: { | ||
@@ -18,2 +18,2 @@ title: 'memes', | ||
console.error(e); | ||
}); | ||
}); |
{ | ||
"name": "snowtransfer", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "Minimalistic Rest client for the Discord Api", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,6 +22,7 @@ const Endpoints = require('../Endpoints'); | ||
* @param {String} inviteId - Id of the invite | ||
* @param {Boolean} [withCounts] - When set to true you get an invite object with additional `approximate_presence_count` and `approximate_member_count` fields | ||
* @returns {Promise.<Invite>} [Invite Object](https://discordapp.com/developers/docs/resources/invite#invite-object) | ||
*/ | ||
async getInvite(inviteId) { | ||
return this.requestHandler.request(Endpoints.INVITE(inviteId), 'get', 'json'); | ||
async getInvite(inviteId, withCounts) { | ||
return this.requestHandler.request(Endpoints.INVITE(inviteId), 'get', 'json', {with_counts: withCounts}); | ||
} | ||
@@ -58,2 +59,2 @@ | ||
module.exports = InviteMethods; | ||
module.exports = InviteMethods; |
@@ -13,19 +13,18 @@ let Raven = require('raven'); | ||
let BotMethods = require('./methods/Bots'); | ||
let AuditLogMethods = require('./methods/AuditLog'); | ||
const Endpoints = require('./Endpoints'); | ||
/** | ||
* @typedef SnowTransfer | ||
* @description The main client to use when you want to execute actions with the discord rest api | ||
* @property {ChannelMethods} channel - Methods for channels | ||
* @property {UserMethods} user - Methods for users | ||
* @property {EmojiMethods} emoji - Methods for emojis | ||
* @property {WebhookMethods} webhook - Methods for webhooks | ||
* @property {GuildMethods} guild - Methods for guilds | ||
* @property {InviteMethods} invite - Methods for invites | ||
* @property {VoiceMethods} voice - Methods for voice | ||
* @property {BotMethods} bot - Methods for bot related things (e.g. Gateway endpoint) | ||
* @property {Raven|null} [raven] - optional [sentry raven](https://docs.sentry.io/clients/node/config/) instance used for catching errors | ||
*/ | ||
class SnowTransfer { | ||
/** | ||
* Create a new Rest Client | ||
* @property {ChannelMethods} channel - Methods for channels | ||
* @property {UserMethods} user - Methods for users | ||
* @property {EmojiMethods} emoji - Methods for emojis | ||
* @property {WebhookMethods} webhook - Methods for webhooks | ||
* @property {GuildMethods} guild - Methods for guilds | ||
* @property {InviteMethods} invite - Methods for invites | ||
* @property {VoiceMethods} voice - Methods for voice | ||
* @property {BotMethods} bot - Methods for bot related things (e.g. Gateway endpoint) | ||
* @property {AuditLogMethods} auditLog - Methods for accessing the audit log of a guild | ||
* @property {Raven|null} [raven] - optional [sentry raven](https://docs.sentry.io/clients/node/config/) instance used for catching errors | ||
* @param {String} token - Discord Bot token to use | ||
@@ -68,5 +67,6 @@ * @param {Object} [options] - options | ||
this.bot = new BotMethods(this.requestHandler); | ||
this.auditLog = new AuditLogMethods(this.requestHandler); | ||
} | ||
} | ||
module.exports = SnowTransfer; | ||
module.exports = SnowTransfer; |
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
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
188249
24
2323