From 7deb431fdf992a9717f2ec28bb9d22751b59a35a Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Thu, 19 Nov 2015 20:22:46 +0000 Subject: [PATCH] More docs --- docs/docs_client.rst | 64 +++++++++++++++++++++++++++++++++++++++++++- src/Client/Client.js | 4 +-- 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/docs/docs_client.rst b/docs/docs_client.rst index a0e235bc9..bc84cea3b 100644 --- a/docs/docs_client.rst +++ b/docs/docs_client.rst @@ -278,4 +278,66 @@ Removes a user from a server - **server** - A `Server Resolvable`_ to kick the user from - **callback** - `function` taking the following: - - **error** - error if any occurred. \ No newline at end of file + - **error** - error if any occurred. + +createInvite(channel, `options`, `callback`) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Creates an invite for the specified channel (or server) + +- **channel** - A `Channel Resolvable`_ +- **options** - `object` containing: + + - **maxAge** - `Number` for maximum time in seconds for invite's validity + - **maxUses** - `Number`, maximum uses of invite + - **temporary** - `Boolean`, whether the invite should be temporary + - **xkcd** - `Boolean`, whether the invite should be human-readable-friendly. +- **callback** - `function` taking the following: + + - **error** - error if any occurred + - **invite** - the created Invite_ + +setStatus(status, `game`, `callback`) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sets the Discord Status of the Client + +- **status** - `String`, either `online` or `idle` +- **game** - `String/Number`, ID of Discord Game being played +- **callback** - `function` taking the following: + + - **error** - error if any occurred + +setTopic(channel, topic, `callback`) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sets the topic of a channel + +- **channel** - A `Channel Resolvable`_ +- **topic** - A `String` +- **callback** - `function` taking the following: + + - **error** - error if any occurred + +setChannelName(channel, name, `callback`) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sets the name of a channel + +- **channel** - A `Channel Resolvable`_ +- **name** - A `String` +- **callback** - `function` taking the following: + + - **error** - error if any occurred + +setChannelNameAndTopic(channel, name, topic, `callback`) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sets the name and topic of a channel + +- **channel** - A `Channel Resolvable`_ +- **name** - A `String` +- **topic** - A `String` +- **callback** - `function` taking the following: + + - **error** - error if any occurred diff --git a/src/Client/Client.js b/src/Client/Client.js index 3c2564707..7af266599 100644 --- a/src/Client/Client.js +++ b/src/Client/Client.js @@ -589,11 +589,11 @@ class Client extends EventEmitter { } //def setChannelName - setChannelName(channel, topic, callback = function (err) { }) { + setChannelName(channel, name, callback = function (err) { }) { var self = this; return new Promise((resolve, reject) => { - self.internal.setChannelName(channel, topic) + self.internal.setChannelName(channel, name) .then(() => { callback(); resolve();