mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Compiled lib
This commit is contained in:
@@ -417,10 +417,10 @@ var Client = (function (_EventEmitter) {
|
||||
|
||||
// def setTopic
|
||||
|
||||
Client.prototype.setTopic = function setTopic(channel, topic) {
|
||||
Client.prototype.setChannelTopic = function setChannelTopic(channel, topic) {
|
||||
var callback = arguments.length <= 2 || arguments[2] === undefined ? function () /*err*/{} : arguments[2];
|
||||
|
||||
return this.internal.setTopic(channel, topic).then(callback, errCB(callback));
|
||||
return this.internal.setChannelTopic(channel, topic).then(callback, errCB(callback));
|
||||
};
|
||||
|
||||
//def setChannelName
|
||||
@@ -439,6 +439,14 @@ var Client = (function (_EventEmitter) {
|
||||
return this.internal.setChannelNameAndTopic(channel, name, topic).then(callback, errCB(callback));
|
||||
};
|
||||
|
||||
//def setChannelPosition
|
||||
|
||||
Client.prototype.setChannelPosition = function setChannelPosition(channel, position) {
|
||||
var callback = arguments.length <= 2 || arguments[2] === undefined ? function () /*err*/{} : arguments[2];
|
||||
|
||||
return this.internal.setChannelPosition(channel, position).then(callback, errCB(callback));
|
||||
};
|
||||
|
||||
//def updateChannel
|
||||
|
||||
Client.prototype.updateChannel = function updateChannel(channel, data) {
|
||||
|
||||
@@ -894,7 +894,7 @@ var InternalClient = (function () {
|
||||
|
||||
//def setTopic
|
||||
|
||||
InternalClient.prototype.setTopic = function setTopic(chann) {
|
||||
InternalClient.prototype.setChannelTopic = function setChannelTopic(chann) {
|
||||
var _this25 = this;
|
||||
|
||||
var topic = arguments.length <= 1 || arguments[1] === undefined ? "" : arguments[1];
|
||||
@@ -948,6 +948,24 @@ var InternalClient = (function () {
|
||||
});
|
||||
};
|
||||
|
||||
//def setTopic
|
||||
|
||||
InternalClient.prototype.setChannelPosition = function setChannelPosition(chann) {
|
||||
var _this28 = this;
|
||||
|
||||
var position = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
|
||||
|
||||
return this.resolver.resolveChannel(chann).then(function (channel) {
|
||||
return _superagent2["default"].patch(_Constants.Endpoints.CHANNEL(channel.id)).set("authorization", _this28.token).send({
|
||||
name: channel.name,
|
||||
position: position,
|
||||
topic: channel.topic
|
||||
}).end().then(function (res) {
|
||||
return channel.position = res.body.position;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
//def updateChannel
|
||||
|
||||
InternalClient.prototype.updateChannel = function updateChannel(chann, data) {
|
||||
|
||||
@@ -5,27 +5,35 @@ exports.__esModule = true;
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var Invite = (function () {
|
||||
function Invite(data, chan, client) {
|
||||
_classCallCheck(this, Invite);
|
||||
function Invite(data, chan, client) {
|
||||
_classCallCheck(this, Invite);
|
||||
|
||||
this.maxAge = data.max_age;
|
||||
this.code = data.code;
|
||||
this.server = chan.server;
|
||||
this.channel = chan;
|
||||
this.revoked = data.revoked;
|
||||
this.createdAt = Date.parse(data.created_at);
|
||||
this.temporary = data.temporary;
|
||||
this.uses = data.uses;
|
||||
this.maxUses = data.uses;
|
||||
this.inviter = client.internal.users.get("id", data.inviter.id);
|
||||
this.xkcd = data.xkcdpass;
|
||||
}
|
||||
this.maxAge = data.max_age;
|
||||
this.code = data.code;
|
||||
this.server = chan.server;
|
||||
this.channel = chan;
|
||||
this.revoked = data.revoked;
|
||||
this.createdAt = Date.parse(data.created_at);
|
||||
this.temporary = data.temporary;
|
||||
this.uses = data.uses;
|
||||
this.maxUses = data.uses;
|
||||
this.inviter = client.internal.users.get("id", data.inviter.id);
|
||||
this.xkcd = data.xkcdpass;
|
||||
}
|
||||
|
||||
Invite.prototype.toString = function toString() {
|
||||
return "https://discord.gg/" + this.code;
|
||||
};
|
||||
Invite.prototype.toString = function toString() {
|
||||
return "https://discord.gg/" + this.code;
|
||||
};
|
||||
|
||||
return Invite;
|
||||
Invite.prototype["delete"] = function _delete() {
|
||||
return this.client.deleteInvite.apply(this.client, reg(this, arguments));
|
||||
};
|
||||
|
||||
Invite.prototype.join = function join() {
|
||||
return this.client.joinServer.apply(this.client, reg(this, arguments));
|
||||
};
|
||||
|
||||
return Invite;
|
||||
})();
|
||||
|
||||
exports["default"] = Invite;
|
||||
|
||||
@@ -60,6 +60,22 @@ var PMChannel = (function (_Channel) {
|
||||
return this.client.sendTTSMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
PMChannel.prototype.sendFile = function sendFile() {
|
||||
return this.client.sendFile.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
PMChannel.prototype.startTyping = function startTyping() {
|
||||
return this.client.startTyping.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
PMChannel.prototype.stopTyping = function stopTyping() {
|
||||
return this.client.stopTyping.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
PMChannel.prototype.getLogs = function getLogs() {
|
||||
return this.client.getChannelLogs.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
_createClass(PMChannel, [{
|
||||
key: "lastMessage",
|
||||
get: function get() {
|
||||
|
||||
@@ -154,7 +154,7 @@ var Role = (function () {
|
||||
};
|
||||
|
||||
Role.prototype.addUser = function addUser(member, callback) {
|
||||
return this.client.addMemberToRole.apply(this.client, [member, this, callback]);
|
||||
return this.client.addUserToRole.apply(this.client, [member, this, callback]);
|
||||
};
|
||||
|
||||
Role.prototype.removeMember = function removeMember(member, callback) {
|
||||
@@ -162,7 +162,7 @@ var Role = (function () {
|
||||
};
|
||||
|
||||
Role.prototype.removeUser = function removeUser(member, callback) {
|
||||
return this.client.removeMemberFromRole.apply(this.client, [member, this, callback]);
|
||||
return this.client.removeUserFromRole.apply(this.client, [member, this, callback]);
|
||||
};
|
||||
|
||||
return Role;
|
||||
|
||||
@@ -118,7 +118,7 @@ var Server = (function (_Equality) {
|
||||
}
|
||||
}
|
||||
|
||||
Server.prototype.details = function details(user) {
|
||||
Server.prototype.detailsOf = function detailsOf(user) {
|
||||
user = this.client.internal.resolver.resolveUser(user);
|
||||
if (user) {
|
||||
return this.memberMap[user.id];
|
||||
@@ -127,7 +127,7 @@ var Server = (function (_Equality) {
|
||||
}
|
||||
};
|
||||
|
||||
Server.prototype.detailsOf = function detailsOf(user) {
|
||||
Server.prototype.detailsOfUser = function detailsOfUser(user) {
|
||||
return this.details(user);
|
||||
};
|
||||
|
||||
@@ -190,6 +190,50 @@ var Server = (function (_Equality) {
|
||||
return this.client.createRole.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Server.prototype.banMember = function banMember(user, tlength, callback) {
|
||||
return this.client.banMember.apply(this.client, [user, this, tlength, callback]);
|
||||
};
|
||||
|
||||
Server.prototype.banUser = function banUser(user, tlength, callback) {
|
||||
return this.client.banMember.apply(this.client, [user, this, tlength, callback]);
|
||||
};
|
||||
|
||||
Server.prototype.ban = function ban(user, tlength, callback) {
|
||||
return this.client.banMember.apply(this.client, [user, this, tlength, callback]);
|
||||
};
|
||||
|
||||
Server.prototype.unbanMember = function unbanMember(user, callback) {
|
||||
return this.client.unbanMember.apply(this.client, [user, this, callback]);
|
||||
};
|
||||
|
||||
Server.prototype.unbanUser = function unbanUser(user, callback) {
|
||||
return this.client.unbanMember.apply(this.client, [user, this, callback]);
|
||||
};
|
||||
|
||||
Server.prototype.unban = function unban(user, callback) {
|
||||
return this.client.unbanMember.apply(this.client, [user, this, callback]);
|
||||
};
|
||||
|
||||
Server.prototype.kickMember = function kickMember(user, callback) {
|
||||
return this.client.kickMember.apply(this.client, [user, this, callback]);
|
||||
};
|
||||
|
||||
Server.prototype.kickUser = function kickUser(user, callback) {
|
||||
return this.client.kickMember.apply(this.client, [user, this, callback]);
|
||||
};
|
||||
|
||||
Server.prototype.kick = function kick(user, callback) {
|
||||
return this.client.kickMember.apply(this.client, [user, this, callback]);
|
||||
};
|
||||
|
||||
Server.prototype.getBans = function getBans() {
|
||||
return this.client.getBans.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Server.prototype.createChannel = function createChannel() {
|
||||
return this.client.createChannel.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
_createClass(Server, [{
|
||||
key: "iconURL",
|
||||
get: function get() {
|
||||
@@ -209,6 +253,16 @@ var Server = (function (_Equality) {
|
||||
get: function get() {
|
||||
return this.channels.get("id", this.id);
|
||||
}
|
||||
}, {
|
||||
key: "generalChannel",
|
||||
get: function get() {
|
||||
return this.defaultChannel;
|
||||
}
|
||||
}, {
|
||||
key: "general",
|
||||
get: function get() {
|
||||
return this.defaultChannel;
|
||||
}
|
||||
}, {
|
||||
key: "owner",
|
||||
get: function get() {
|
||||
|
||||
@@ -127,6 +127,10 @@ var ServerChannel = (function (_Channel) {
|
||||
return this.client.setChannelName.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
ServerChannel.prototype.setPosition = function setPosition() {
|
||||
return this.client.setChannelPosition.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
return ServerChannel;
|
||||
})(_Channel3["default"]);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ var TextChannel = (function (_ServerChannel) {
|
||||
/* warning! may return null */
|
||||
|
||||
TextChannel.prototype.setTopic = function setTopic() {
|
||||
return this.client.setTopic.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
return this.client.setChannelTopic.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
TextChannel.prototype.setNameAndTopic = function setNameAndTopic() {
|
||||
@@ -63,6 +63,22 @@ var TextChannel = (function (_ServerChannel) {
|
||||
return this.client.sendTTSMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
TextChannel.prototype.sendFile = function sendFile() {
|
||||
return this.client.sendFile.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
TextChannel.prototype.getLogs = function getLogs() {
|
||||
return this.client.getChannelLogs.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
TextChannel.prototype.startTyping = function startTyping() {
|
||||
return this.client.startTyping.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
TextChannel.prototype.stopTyping = function stopTyping() {
|
||||
return this.client.stopTyping.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
_createClass(TextChannel, [{
|
||||
key: "lastMessage",
|
||||
get: function get() {
|
||||
|
||||
@@ -70,6 +70,18 @@ var User = (function (_Equality) {
|
||||
return this.client.sendTTSMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
User.prototype.sendFile = function sendFile() {
|
||||
return this.client.sendFile.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
User.prototype.startTyping = function startTyping() {
|
||||
return this.client.startTyping.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
User.prototype.stopTyping = function stopTyping() {
|
||||
return this.client.stopTyping.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
User.prototype.addTo = function addTo(role, callback) {
|
||||
return this.client.addMemberToRole.apply(this.client, [this, role, callback]);
|
||||
};
|
||||
@@ -78,6 +90,10 @@ var User = (function (_Equality) {
|
||||
return this.client.removeMemberFromRole.apply(this.client, [this, role, callback]);
|
||||
};
|
||||
|
||||
User.prototype.getLogs = function getLogs() {
|
||||
return this.client.getChannelLogs.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
_createClass(User, [{
|
||||
key: "avatarURL",
|
||||
get: function get() {
|
||||
|
||||
Reference in New Issue
Block a user