mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
Don't require a server for moveMember
This commit is contained in:
@@ -276,13 +276,12 @@ Removes a user from a server
|
|||||||
- **callback** - `function` taking the following:
|
- **callback** - `function` taking the following:
|
||||||
- **error** - error if any occurred.
|
- **error** - error if any occurred.
|
||||||
|
|
||||||
moveMember(user, server, channel, `callback`)
|
moveMember(user, channel, `callback`)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Moves a user from one voice channel into another.
|
Moves a user from one voice channel into another.
|
||||||
|
|
||||||
- **user** - A `User Resolvable`_ that should be moved
|
- **user** - A `User Resolvable`_ that should be moved
|
||||||
- **server** - A `Server Resolvable`_ in which to move the user
|
|
||||||
- **channel** - The `Channel Resolvable`_ to move the user to
|
- **channel** - The `Channel Resolvable`_ to move the user to
|
||||||
- **callback** - `function` taking the following:
|
- **callback** - `function` taking the following:
|
||||||
- **error** - error if any occurred.
|
- **error** - error if any occurred.
|
||||||
|
|||||||
@@ -316,10 +316,10 @@ var Client = (function (_EventEmitter) {
|
|||||||
|
|
||||||
// def moveMember
|
// def moveMember
|
||||||
|
|
||||||
Client.prototype.moveMember = function moveMember(user, server, channel) {
|
Client.prototype.moveMember = function moveMember(user, channel) {
|
||||||
var callback = arguments.length <= 3 || arguments[3] === undefined ? function () /*err, {}*/{} : arguments[3];
|
var callback = arguments.length <= 2 || arguments[2] === undefined ? function () /*err, {}*/{} : arguments[2];
|
||||||
|
|
||||||
return this.internal.moveMember(user, server, channel).then(dataCallback(callback), errorCallback(callback));
|
return this.internal.moveMember(user, channel).then(dataCallback(callback), errorCallback(callback));
|
||||||
};
|
};
|
||||||
|
|
||||||
// def createRole
|
// def createRole
|
||||||
|
|||||||
@@ -696,12 +696,13 @@ var InternalClient = (function () {
|
|||||||
|
|
||||||
// def moveMember
|
// def moveMember
|
||||||
|
|
||||||
InternalClient.prototype.moveMember = function moveMember(user, server, channel) {
|
InternalClient.prototype.moveMember = function moveMember(user, channel) {
|
||||||
var _this19 = this;
|
var _this19 = this;
|
||||||
|
|
||||||
user = this.resolver.resolveUser(user);
|
user = this.resolver.resolveUser(user);
|
||||||
server = this.resolver.resolveServer(server);
|
|
||||||
return this.resolver.resolveChannel(channel).then(function (channel) {
|
return this.resolver.resolveChannel(channel).then(function (channel) {
|
||||||
|
var server = channel.server;
|
||||||
|
|
||||||
// Make sure `channel` is a voice channel
|
// Make sure `channel` is a voice channel
|
||||||
if (channel.type !== "voice") {
|
if (channel.type !== "voice") {
|
||||||
throw new Error("Can't moveMember into a non-voice channel");
|
throw new Error("Can't moveMember into a non-voice channel");
|
||||||
|
|||||||
@@ -274,8 +274,8 @@ export default class Client extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// def moveMember
|
// def moveMember
|
||||||
moveMember(user, server, channel, callback = (/*err, {}*/) => { }) {
|
moveMember(user, channel, callback = (/*err, {}*/) => { }) {
|
||||||
return this.internal.moveMember(user, server, channel)
|
return this.internal.moveMember(user, channel)
|
||||||
.then(dataCallback(callback), errorCallback(callback));
|
.then(dataCallback(callback), errorCallback(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -573,10 +573,11 @@ export default class InternalClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// def moveMember
|
// def moveMember
|
||||||
moveMember(user, server, channel) {
|
moveMember(user, channel) {
|
||||||
user = this.resolver.resolveUser(user);
|
user = this.resolver.resolveUser(user);
|
||||||
server = this.resolver.resolveServer(server);
|
|
||||||
return this.resolver.resolveChannel(channel).then(channel => {
|
return this.resolver.resolveChannel(channel).then(channel => {
|
||||||
|
var server = channel.server;
|
||||||
|
|
||||||
// Make sure `channel` is a voice channel
|
// Make sure `channel` is a voice channel
|
||||||
if(channel.type !== "voice") {
|
if(channel.type !== "voice") {
|
||||||
throw new Error("Can't moveMember into a non-voice channel");
|
throw new Error("Can't moveMember into a non-voice channel");
|
||||||
|
|||||||
Reference in New Issue
Block a user