mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
More docs
This commit is contained in:
@@ -278,4 +278,66 @@ Removes a user from a server
|
|||||||
- **server** - A `Server Resolvable`_ to kick the user from
|
- **server** - A `Server Resolvable`_ to kick the user from
|
||||||
- **callback** - `function` taking the following:
|
- **callback** - `function` taking the following:
|
||||||
|
|
||||||
- **error** - error if any occurred.
|
- **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
|
||||||
|
|||||||
@@ -589,11 +589,11 @@ class Client extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//def setChannelName
|
//def setChannelName
|
||||||
setChannelName(channel, topic, callback = function (err) { }) {
|
setChannelName(channel, name, callback = function (err) { }) {
|
||||||
var self = this;
|
var self = this;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
||||||
self.internal.setChannelName(channel, topic)
|
self.internal.setChannelName(channel, name)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
callback();
|
callback();
|
||||||
resolve();
|
resolve();
|
||||||
|
|||||||
Reference in New Issue
Block a user