mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Add voice channel moving, not quite working yet
This commit is contained in:
@@ -694,6 +694,25 @@ var InternalClient = (function () {
|
||||
return this.apiRequest("del", _Constants.Endpoints.SERVER_MEMBERS(server.id) + "/" + user.id, true);
|
||||
};
|
||||
|
||||
// def moveMember
|
||||
|
||||
InternalClient.prototype.moveMember = function moveMember(user, server, channel) {
|
||||
user = this.resolver.resolveUser(user);
|
||||
server = this.resolver.resolveServer(server);
|
||||
channel = this.resolver.resolveChannel(channel);
|
||||
|
||||
console.log(channel.type);
|
||||
// Make sure `channel` is a voice channel
|
||||
if (channel.type !== "voice") {
|
||||
throw new Error("Can't moveMember into a non-voice channel");
|
||||
} else {
|
||||
return this.apiRequest("patch", _Constants.Endpoints.SERVER_MEMBERS(server.id) + "/" + user.id, true, { channel_id: channel.id }).then(function (res) {
|
||||
user.voiceChannel = channel;
|
||||
return res;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// def createRole
|
||||
|
||||
InternalClient.prototype.createRole = function createRole(server, data) {
|
||||
|
||||
Reference in New Issue
Block a user