mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Added leave server and other stuff
This commit is contained in:
@@ -52,10 +52,10 @@ var Server = (function (_Equality) {
|
||||
|
||||
data.channels.forEach(function (dataChannel) {
|
||||
if (dataChannel.type === "text") {
|
||||
var channel = client.internal.channels.add(new TextChannel(dataChannel, client));
|
||||
var channel = client.internal.channels.add(new TextChannel(dataChannel, client, _this));
|
||||
_this.channels.add(channel);
|
||||
} else {
|
||||
var channel = client.internal.channels.add(new VoiceChannel(dataChannel, client));
|
||||
var channel = client.internal.channels.add(new VoiceChannel(dataChannel, client, _this));
|
||||
_this.channels.add(channel);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ var PermissionOverwrite = require("./PermissionOverwrite.js");
|
||||
var ServerChannel = (function (_Channel) {
|
||||
_inherits(ServerChannel, _Channel);
|
||||
|
||||
function ServerChannel(data, client) {
|
||||
function ServerChannel(data, client, server) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, ServerChannel);
|
||||
@@ -20,6 +20,7 @@ var ServerChannel = (function (_Channel) {
|
||||
this.name = data.name;
|
||||
this.type = data.type;
|
||||
this.permissionOverwrites = new Cache();
|
||||
this.server = server;
|
||||
data.permission_overwrites.forEach(function (permission) {
|
||||
_this.permissionOverwrites.add(new PermissionOverwrite(permission));
|
||||
});
|
||||
|
||||
@@ -12,10 +12,10 @@ var Cache = require("../Util/Cache.js");
|
||||
var TextChannel = (function (_ServerChannel) {
|
||||
_inherits(TextChannel, _ServerChannel);
|
||||
|
||||
function TextChannel(data, client) {
|
||||
function TextChannel(data, client, server) {
|
||||
_classCallCheck(this, TextChannel);
|
||||
|
||||
_ServerChannel.call(this, data, client);
|
||||
_ServerChannel.call(this, data, client, server);
|
||||
|
||||
this.name = data.name;
|
||||
this.topic = data.topic;
|
||||
|
||||
@@ -9,10 +9,10 @@ var ServerChannel = require("./ServerChannel.js");
|
||||
var VoiceChannel = (function (_ServerChannel) {
|
||||
_inherits(VoiceChannel, _ServerChannel);
|
||||
|
||||
function VoiceChannel(data, client) {
|
||||
function VoiceChannel(data, client, server) {
|
||||
_classCallCheck(this, VoiceChannel);
|
||||
|
||||
_ServerChannel.call(this, data, client);
|
||||
_ServerChannel.call(this, data, client, server);
|
||||
}
|
||||
|
||||
return VoiceChannel;
|
||||
|
||||
Reference in New Issue
Block a user