mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Merge remote-tracking branch 'upstream/indev' into indev
This commit is contained in:
@@ -79,6 +79,10 @@ var Message = (function (_Equality) {
|
||||
return this.client.updateMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Message.prototype.edit = function edit() {
|
||||
return this.client.updateMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Message.prototype.reply = function reply() {
|
||||
return this.client.reply.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
@@ -48,10 +48,18 @@ var PMChannel = (function (_Channel) {
|
||||
return this.client.sendMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
PMChannel.prototype.send = function send() {
|
||||
return this.client.sendMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
PMChannel.prototype.sendTTSMessage = function sendTTSMessage() {
|
||||
return this.client.sendTTSMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
PMChannel.prototype.sendTTS = function sendTTS() {
|
||||
return this.client.sendTTSMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
_createClass(PMChannel, [{
|
||||
key: "lastMessage",
|
||||
get: function get() {
|
||||
|
||||
@@ -5,6 +5,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
|
||||
var _Constants = require("../Constants");
|
||||
|
||||
var _UtilArgumentRegulariser = require("../Util/ArgumentRegulariser");
|
||||
|
||||
/*
|
||||
|
||||
example data
|
||||
@@ -135,6 +137,34 @@ var Role = (function () {
|
||||
return "#" + val;
|
||||
};
|
||||
|
||||
Role.prototype["delete"] = function _delete() {
|
||||
return this.client.deleteRole.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Role.prototype.edit = function edit() {
|
||||
return this.client.updateRole.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Role.prototype.update = function update() {
|
||||
return this.client.updateRole.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Role.prototype.addMember = function addMember(member, callback) {
|
||||
return this.client.addMemberToRole.apply(this.client, [member, this, callback]);
|
||||
};
|
||||
|
||||
Role.prototype.addUser = function addUser(member, callback) {
|
||||
return this.client.addMemberToRole.apply(this.client, [member, this, callback]);
|
||||
};
|
||||
|
||||
Role.prototype.removeMember = function removeMember(member, callback) {
|
||||
return this.client.removeMemberFromRole.apply(this.client, [member, this, callback]);
|
||||
};
|
||||
|
||||
Role.prototype.removeUser = function removeUser(member, callback) {
|
||||
return this.client.removeMemberFromRole.apply(this.client, [member, this, callback]);
|
||||
};
|
||||
|
||||
return Role;
|
||||
})();
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@ var _Role = require("./Role");
|
||||
|
||||
var _Role2 = _interopRequireDefault(_Role);
|
||||
|
||||
var _UtilArgumentRegulariser = require("../Util/ArgumentRegulariser");
|
||||
|
||||
var strictKeys = ["region", "ownerID", "name", "id", "icon", "afkTimeout", "afkChannelID"];
|
||||
|
||||
var Server = (function (_Equality) {
|
||||
@@ -172,6 +174,22 @@ var Server = (function (_Equality) {
|
||||
return true;
|
||||
};
|
||||
|
||||
Server.prototype.leave = function leave() {
|
||||
return this.client.leaveServer.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Server.prototype["delete"] = function _delete() {
|
||||
return this.client.leaveServer.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Server.prototype.createInvite = function createInvite() {
|
||||
return this.client.createInvite.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
Server.prototype.createRole = function createRole() {
|
||||
return this.client.createRole.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
_createClass(Server, [{
|
||||
key: "iconURL",
|
||||
get: function get() {
|
||||
|
||||
@@ -51,10 +51,18 @@ var TextChannel = (function (_ServerChannel) {
|
||||
return this.client.sendMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
TextChannel.prototype.send = function send() {
|
||||
return this.client.sendMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
TextChannel.prototype.sendTTSMessage = function sendTTSMessage() {
|
||||
return this.client.sendTTSMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
TextChannel.prototype.sendTTS = function sendTTS() {
|
||||
return this.client.sendTTSMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
_createClass(TextChannel, [{
|
||||
key: "lastMessage",
|
||||
get: function get() {
|
||||
|
||||
@@ -16,6 +16,8 @@ var _UtilEquality2 = _interopRequireDefault(_UtilEquality);
|
||||
|
||||
var _Constants = require("../Constants");
|
||||
|
||||
var _UtilArgumentRegulariser = require("../Util/ArgumentRegulariser");
|
||||
|
||||
var User = (function (_Equality) {
|
||||
_inherits(User, _Equality);
|
||||
|
||||
@@ -52,6 +54,30 @@ var User = (function (_Equality) {
|
||||
if (obj instanceof User) return this.id === obj.id && this.username === obj.username && this.discriminator === obj.discriminator && this.avatar === obj.avatar;else return false;
|
||||
};
|
||||
|
||||
User.prototype.sendMessage = function sendMessage() {
|
||||
return this.client.sendMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
User.prototype.send = function send() {
|
||||
return this.client.sendMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
User.prototype.sendTTSMessage = function sendTTSMessage() {
|
||||
return this.client.sendTTSMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
User.prototype.sendTTS = function sendTTS() {
|
||||
return this.client.sendTTSMessage.apply(this.client, _UtilArgumentRegulariser.reg(this, arguments));
|
||||
};
|
||||
|
||||
User.prototype.addTo = function addTo(role, callback) {
|
||||
return this.client.addMemberToRole.apply(this.client, [this, role, callback]);
|
||||
};
|
||||
|
||||
User.prototype.removeFrom = function removeFrom(role, callback) {
|
||||
return this.client.removeMemberFromRole.apply(this.client, [this, role, callback]);
|
||||
};
|
||||
|
||||
_createClass(User, [{
|
||||
key: "avatarURL",
|
||||
get: function get() {
|
||||
|
||||
@@ -12,6 +12,8 @@ var _ServerChannel2 = require("./ServerChannel");
|
||||
|
||||
var _ServerChannel3 = _interopRequireDefault(_ServerChannel2);
|
||||
|
||||
var _UtilArgumentRegulariser = require("../Util/ArgumentRegulariser");
|
||||
|
||||
var VoiceChannel = (function (_ServerChannel) {
|
||||
_inherits(VoiceChannel, _ServerChannel);
|
||||
|
||||
@@ -21,6 +23,12 @@ var VoiceChannel = (function (_ServerChannel) {
|
||||
_ServerChannel.call(this, data, client, server);
|
||||
}
|
||||
|
||||
VoiceChannel.prototype.join = function join() {
|
||||
var callback = arguments.length <= 0 || arguments[0] === undefined ? function () {} : arguments[0];
|
||||
|
||||
return this.client.joinVoiceChannel.apply(this.client, [this, callback]);
|
||||
};
|
||||
|
||||
return VoiceChannel;
|
||||
})(_ServerChannel3["default"]);
|
||||
|
||||
|
||||
@@ -19,4 +19,6 @@ export default class Channel extends Equality {
|
||||
return this.client.deleteChannel.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -60,6 +60,10 @@ export default class Message extends Equality{
|
||||
update(){
|
||||
return this.client.updateMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
edit() {
|
||||
return this.client.updateMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
reply(){
|
||||
return this.client.reply.apply(this.client, reg(this, arguments));
|
||||
|
||||
@@ -27,8 +27,32 @@ export default class PMChannel extends Channel {
|
||||
sendMessage(){
|
||||
return this.client.sendMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
send() {
|
||||
return this.client.sendMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
sendTTSMessage(){
|
||||
return this.client.sendTTSMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
sendTTS() {
|
||||
return this.client.sendTTSMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
sendFile() {
|
||||
return this.client.sendFile.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
startTyping() {
|
||||
return this.client.startTyping.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
stopTyping() {
|
||||
return this.client.startTyping.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
getLogs() {
|
||||
return this.client.getChannelLogs.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
import {Permissions} from "../Constants";
|
||||
import {reg} from "../Util/ArgumentRegulariser";
|
||||
/*
|
||||
|
||||
example data
|
||||
@@ -130,4 +131,32 @@ export default class Role {
|
||||
}
|
||||
return "#"+val;
|
||||
}
|
||||
|
||||
delete() {
|
||||
return this.client.deleteRole.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
edit() {
|
||||
return this.client.updateRole.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
update() {
|
||||
return this.client.updateRole.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
addMember(member, callback) {
|
||||
return this.client.addMemberToRole.apply(this.client, [member, this, callback]);
|
||||
}
|
||||
|
||||
addUser(member, callback) {
|
||||
return this.client.addMemberToRole.apply(this.client, [member, this, callback]);
|
||||
}
|
||||
|
||||
removeMember(member, callback) {
|
||||
return this.client.removeMemberFromRole.apply(this.client, [member, this, callback]);
|
||||
}
|
||||
|
||||
removeUser(member, callback) {
|
||||
return this.client.removeMemberFromRole.apply(this.client, [member, this, callback]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import User from "./User";
|
||||
import TextChannel from "./TextChannel";
|
||||
import VoiceChannel from "./VoiceChannel";
|
||||
import Role from "./Role";
|
||||
import {reg} from "../Util/ArgumentRegulariser";
|
||||
|
||||
var strictKeys = [
|
||||
"region", "ownerID", "name", "id", "icon", "afkTimeout", "afkChannelID"
|
||||
@@ -111,6 +112,14 @@ export default class Server extends Equality {
|
||||
get defaultChannel() {
|
||||
return this.channels.get("id", this.id);
|
||||
}
|
||||
|
||||
get generalChannel() {
|
||||
return this.defaultChannel;
|
||||
}
|
||||
|
||||
get general() {
|
||||
return this.defaultChannel;
|
||||
}
|
||||
|
||||
get owner() {
|
||||
return this.members.get("id", this.ownerID);
|
||||
@@ -132,5 +141,65 @@ export default class Server extends Equality {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
leave() {
|
||||
return this.client.leaveServer.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
delete() {
|
||||
return this.client.leaveServer.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
createInvite() {
|
||||
return this.client.createInvite.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
createRole() {
|
||||
return this.client.createRole.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
banMember(user, tlength, callback) {
|
||||
return this.client.banMember.apply(this.client, [user, this, tlength, callback]);
|
||||
}
|
||||
|
||||
banUser(user, tlength, callback) {
|
||||
return this.client.banMember.apply(this.client, [user, this, tlength, callback]);
|
||||
}
|
||||
|
||||
ban(user, tlength, callback) {
|
||||
return this.client.banMember.apply(this.client, [user, this, tlength, callback]);
|
||||
}
|
||||
|
||||
unbanMember(user, callback) {
|
||||
return this.client.unbanMember.apply(this.client, [user, this, callback]);
|
||||
}
|
||||
|
||||
unbanUser(user, callback) {
|
||||
return this.client.unbanMember.apply(this.client, [user, this, callback]);
|
||||
}
|
||||
|
||||
unban(user, callback) {
|
||||
return this.client.unbanMember.apply(this.client, [user, this, callback]);
|
||||
}
|
||||
|
||||
kickMember(user, callback) {
|
||||
return this.client.kickMember.apply(this.client, [user, this, callback]);
|
||||
}
|
||||
|
||||
kickUser(user, callback) {
|
||||
return this.client.kickMember.apply(this.client, [user, this, callback]);
|
||||
}
|
||||
|
||||
kick(user, callback) {
|
||||
return this.client.kickMember.apply(this.client, [user, this, callback]);
|
||||
}
|
||||
|
||||
getBans(callback) {
|
||||
return this.client.getBans.apply(this.client, [this, callback]);
|
||||
}
|
||||
|
||||
createChannel() {
|
||||
return this.client.createChannel.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,8 +33,32 @@ export default class TextChannel extends ServerChannel{
|
||||
sendMessage(){
|
||||
return this.client.sendMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
send() {
|
||||
return this.client.sendMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
sendTTSMessage(){
|
||||
return this.client.sendTTSMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
sendTTS() {
|
||||
return this.client.sendTTSMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
sendFile() {
|
||||
return this.client.sendFile.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
getLogs() {
|
||||
return this.client.getChannelLogs.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
startTyping() {
|
||||
return this.client.startTyping.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
stopTyping() {
|
||||
return this.client.startTyping.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import Equality from "../Util/Equality";
|
||||
import {Endpoints} from "../Constants";
|
||||
import {reg} from "../Util/ArgumentRegulariser";
|
||||
|
||||
export default class User extends Equality{
|
||||
constructor(data, client){
|
||||
@@ -60,4 +61,44 @@ export default class User extends Equality{
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
sendMessage(){
|
||||
return this.client.sendMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
send() {
|
||||
return this.client.sendMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
sendTTSMessage(){
|
||||
return this.client.sendTTSMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
sendTTS() {
|
||||
return this.client.sendTTSMessage.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
sendFile() {
|
||||
return this.client.sendFile.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
startTyping() {
|
||||
return this.client.startTyping.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
stopTyping() {
|
||||
return this.client.startTyping.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
|
||||
addTo(role, callback) {
|
||||
return this.client.addMemberToRole.apply(this.client, [this, role, callback]);
|
||||
}
|
||||
|
||||
removeFrom(role, callback) {
|
||||
return this.client.removeMemberFromRole.apply(this.client, [this, role, callback]);
|
||||
}
|
||||
|
||||
getLogs() {
|
||||
return this.client.getChannelLogs.apply(this.client, reg(this, arguments));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
import ServerChannel from "./ServerChannel";
|
||||
import {reg} from "../Util/ArgumentRegulariser";
|
||||
|
||||
export default class VoiceChannel extends ServerChannel{
|
||||
constructor(data, client, server){
|
||||
super(data, client, server);
|
||||
}
|
||||
|
||||
join(callback = function () { }) {
|
||||
return this.client.joinVoiceChannel.apply(this.client, [this, callback]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user