mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Small fixes
This commit is contained in:
@@ -874,9 +874,13 @@ var InternalClient = (function () {
|
||||
throw new Error("user not found");
|
||||
}
|
||||
|
||||
return !!role.server.rolesOf(member).find(function (r) {
|
||||
return r.id == role.id;
|
||||
});
|
||||
var roledata = role.server.rolesOf(member);
|
||||
if (roledata) {
|
||||
return roledata.find(function (r) {
|
||||
return r.id == role.id;
|
||||
});
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
//def removeMemberFromRole
|
||||
@@ -942,13 +946,7 @@ var InternalClient = (function () {
|
||||
InternalClient.prototype.createInvite = function createInvite(chanServ, options) {
|
||||
var _this25 = this;
|
||||
|
||||
if (chanServ instanceof _StructuresChannel2["default"]) {
|
||||
// do something
|
||||
} else if (chanServ instanceof _StructuresServer2["default"]) {
|
||||
// do something
|
||||
} else {
|
||||
chanServ = this.resolver.resolveServer(chanServ) || this.resolver.resolveChannel(chanServ);
|
||||
}
|
||||
chanServ = this.resolver.resolveChannel(chanServ);
|
||||
|
||||
if (!chanServ) {
|
||||
throw new Error("couldn't resolve where");
|
||||
@@ -965,14 +963,7 @@ var InternalClient = (function () {
|
||||
options.xkcdpass = options.xkcd || false;
|
||||
}
|
||||
|
||||
var epoint;
|
||||
if (chanServ instanceof _StructuresChannel2["default"]) {
|
||||
epoint = _Constants.Endpoints.CHANNEL_INVITES(chanServ.id);
|
||||
} else {
|
||||
epoint = _Constants.Endpoints.SERVER_INVITES(chanServ.id);
|
||||
}
|
||||
|
||||
return this.apiRequest("post", epoint, true, options).then(function (res) {
|
||||
return this.apiRequest("post", _Constants.Endpoints.CHANNEL_INVITES(chanServ.id), true, options).then(function (res) {
|
||||
return new _StructuresInvite2["default"](res, _this25.channels.get("id", res.channel.id), _this25.client);
|
||||
});
|
||||
};
|
||||
@@ -1107,6 +1098,9 @@ var InternalClient = (function () {
|
||||
|
||||
this.sendWS(packet);
|
||||
|
||||
this.bot.user.status = this.idleStatus;
|
||||
this.bot.user.game = this.game;
|
||||
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user