From f95822dcb7d343308066065eeb06a748459a8cc4 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Sat, 5 Dec 2015 16:48:09 +0000 Subject: [PATCH] Added message.edit, textchannel.send, textchannel.sendTTS and pmchannel.send, pmchannel.sendTTS --- lib/Client/Client.js | 2 +- lib/Client/ConnectionState.js | 2 +- lib/Client/InternalClient.js | 2 +- lib/Client/Resolver/Resolver.js | 2 +- lib/Constants.js | 2 +- lib/Structures/Channel.js | 2 +- lib/Structures/ChannelPermissions.js | 2 +- lib/Structures/Invite.js | 2 +- lib/Structures/Message.js | 6 +++++- lib/Structures/PMChannel.js | 10 +++++++++- lib/Structures/PermissionOverwrite.js | 2 +- lib/Structures/Role.js | 2 +- lib/Structures/Server.js | 2 +- lib/Structures/ServerChannel.js | 2 +- lib/Structures/TextChannel.js | 10 +++++++++- lib/Structures/User.js | 2 +- lib/Structures/VoiceChannel.js | 2 +- lib/Util/ArgumentRegulariser.js | 2 +- lib/Util/Cache.js | 2 +- lib/Util/Equality.js | 2 +- lib/Voice/AudioEncoder.js | 2 +- lib/Voice/StreamIntent.js | 2 +- lib/Voice/VoiceConnection.js | 2 +- lib/Voice/VoicePacket.js | 2 +- lib/index.js | 2 +- src/Structures/Message.js | 4 ++++ src/Structures/PMChannel.js | 8 ++++++++ src/Structures/TextChannel.js | 8 ++++++++ 28 files changed, 65 insertions(+), 25 deletions(-) diff --git a/lib/Client/Client.js b/lib/Client/Client.js index e575920c4..5d34363e4 100644 --- a/lib/Client/Client.js +++ b/lib/Client/Client.js @@ -630,4 +630,4 @@ var Client = (function (_EventEmitter) { })(_events2["default"]); exports["default"] = Client; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Client/ConnectionState.js b/lib/Client/ConnectionState.js index b17e17a5e..e876542d8 100644 --- a/lib/Client/ConnectionState.js +++ b/lib/Client/ConnectionState.js @@ -8,4 +8,4 @@ exports["default"] = { READY: 3, DISCONNECTED: 4 }; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index 6dd35d5ea..854bd1ed5 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -1416,4 +1416,4 @@ var InternalClient = (function () { })(); exports["default"] = InternalClient; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Client/Resolver/Resolver.js b/lib/Client/Resolver/Resolver.js index b05ac0363..c602e4949 100644 --- a/lib/Client/Resolver/Resolver.js +++ b/lib/Client/Resolver/Resolver.js @@ -245,4 +245,4 @@ var Resolver = (function () { })(); exports["default"] = Resolver; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Constants.js b/lib/Constants.js index 13b465ae1..3381d3c5b 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -127,4 +127,4 @@ var PacketType = { SERVER_BAN_ADD: "GUILD_BAN_ADD", SERVER_BAN_REMOVE: "GUILD_BAN_REMOVE" }; -exports.PacketType = PacketType; +exports.PacketType = PacketType; \ No newline at end of file diff --git a/lib/Structures/Channel.js b/lib/Structures/Channel.js index c573a3a10..887420059 100644 --- a/lib/Structures/Channel.js +++ b/lib/Structures/Channel.js @@ -42,4 +42,4 @@ var Channel = (function (_Equality) { })(_UtilEquality2["default"]); exports["default"] = Channel; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/ChannelPermissions.js b/lib/Structures/ChannelPermissions.js index 81773a75e..8f2fccab3 100644 --- a/lib/Structures/ChannelPermissions.js +++ b/lib/Structures/ChannelPermissions.js @@ -75,4 +75,4 @@ var ChannelPermissions = (function () { })(); exports["default"] = ChannelPermissions; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/Invite.js b/lib/Structures/Invite.js index 27d470b9c..12d349cae 100644 --- a/lib/Structures/Invite.js +++ b/lib/Structures/Invite.js @@ -29,4 +29,4 @@ var Invite = (function () { })(); exports["default"] = Invite; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/Message.js b/lib/Structures/Message.js index 7e0942514..9c5578da9 100644 --- a/lib/Structures/Message.js +++ b/lib/Structures/Message.js @@ -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)); }; @@ -98,4 +102,4 @@ var Message = (function (_Equality) { })(_UtilEquality2["default"]); exports["default"] = Message; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/PMChannel.js b/lib/Structures/PMChannel.js index 61a77e465..b51830ea8 100644 --- a/lib/Structures/PMChannel.js +++ b/lib/Structures/PMChannel.js @@ -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() { @@ -63,4 +71,4 @@ var PMChannel = (function (_Channel) { })(_Channel3["default"]); exports["default"] = PMChannel; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/PermissionOverwrite.js b/lib/Structures/PermissionOverwrite.js index 6682c168a..ac539d4d5 100644 --- a/lib/Structures/PermissionOverwrite.js +++ b/lib/Structures/PermissionOverwrite.js @@ -86,4 +86,4 @@ var PermissionOverwrite = (function () { })(); exports["default"] = PermissionOverwrite; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/Role.js b/lib/Structures/Role.js index 1aa4ce25b..a9c796639 100644 --- a/lib/Structures/Role.js +++ b/lib/Structures/Role.js @@ -139,4 +139,4 @@ var Role = (function () { })(); exports["default"] = Role; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/Server.js b/lib/Structures/Server.js index 57893d23d..e624654dc 100644 --- a/lib/Structures/Server.js +++ b/lib/Structures/Server.js @@ -202,4 +202,4 @@ var Server = (function (_Equality) { })(_UtilEquality2["default"]); exports["default"] = Server; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/ServerChannel.js b/lib/Structures/ServerChannel.js index 57ad3f21f..333f09f4e 100644 --- a/lib/Structures/ServerChannel.js +++ b/lib/Structures/ServerChannel.js @@ -131,4 +131,4 @@ var ServerChannel = (function (_Channel) { })(_Channel3["default"]); exports["default"] = ServerChannel; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/TextChannel.js b/lib/Structures/TextChannel.js index 92fa7566f..1e832eb0e 100644 --- a/lib/Structures/TextChannel.js +++ b/lib/Structures/TextChannel.js @@ -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() { @@ -66,4 +74,4 @@ var TextChannel = (function (_ServerChannel) { })(_ServerChannel3["default"]); exports["default"] = TextChannel; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/User.js b/lib/Structures/User.js index 259da1efc..6f1c50f61 100644 --- a/lib/Structures/User.js +++ b/lib/Structures/User.js @@ -67,4 +67,4 @@ var User = (function (_Equality) { })(_UtilEquality2["default"]); exports["default"] = User; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Structures/VoiceChannel.js b/lib/Structures/VoiceChannel.js index f73bbfade..7dd54aa5c 100644 --- a/lib/Structures/VoiceChannel.js +++ b/lib/Structures/VoiceChannel.js @@ -25,4 +25,4 @@ var VoiceChannel = (function (_ServerChannel) { })(_ServerChannel3["default"]); exports["default"] = VoiceChannel; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Util/ArgumentRegulariser.js b/lib/Util/ArgumentRegulariser.js index cee9d5a57..e51909e5f 100644 --- a/lib/Util/ArgumentRegulariser.js +++ b/lib/Util/ArgumentRegulariser.js @@ -5,4 +5,4 @@ exports.reg = reg; function reg(c, a) { return [c].concat(Array.prototype.slice.call(a)); -} +} \ No newline at end of file diff --git a/lib/Util/Cache.js b/lib/Util/Cache.js index 3932779be..f3b22a70f 100644 --- a/lib/Util/Cache.js +++ b/lib/Util/Cache.js @@ -106,4 +106,4 @@ var Cache = (function (_Array) { })(Array); exports["default"] = Cache; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Util/Equality.js b/lib/Util/Equality.js index aab165350..2963f1d51 100644 --- a/lib/Util/Equality.js +++ b/lib/Util/Equality.js @@ -45,4 +45,4 @@ var Equality = (function () { })(); exports["default"] = Equality; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Voice/AudioEncoder.js b/lib/Voice/AudioEncoder.js index 4b8489b9b..6aecca898 100644 --- a/lib/Voice/AudioEncoder.js +++ b/lib/Voice/AudioEncoder.js @@ -132,4 +132,4 @@ var AudioEncoder = (function () { })(); exports["default"] = AudioEncoder; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Voice/StreamIntent.js b/lib/Voice/StreamIntent.js index 37b981a14..e3fda0e83 100644 --- a/lib/Voice/StreamIntent.js +++ b/lib/Voice/StreamIntent.js @@ -25,4 +25,4 @@ var StreamIntent = (function (_EventEmitter) { })(_events2["default"]); exports["default"] = StreamIntent; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Voice/VoiceConnection.js b/lib/Voice/VoiceConnection.js index ac43034ea..886f2c1d4 100644 --- a/lib/Voice/VoiceConnection.js +++ b/lib/Voice/VoiceConnection.js @@ -363,4 +363,4 @@ var VoiceConnection = (function (_EventEmitter) { })(_events2["default"]); exports["default"] = VoiceConnection; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/Voice/VoicePacket.js b/lib/Voice/VoicePacket.js index 445f9d6c4..71b9fbaaf 100644 --- a/lib/Voice/VoicePacket.js +++ b/lib/Voice/VoicePacket.js @@ -26,4 +26,4 @@ var VoicePacket = function VoicePacket(data, sequence, time, ssrc) { }; exports["default"] = VoicePacket; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index f5ef732bc..3029911ad 100644 --- a/lib/index.js +++ b/lib/index.js @@ -76,4 +76,4 @@ exports["default"] = { VoiceChannel: _StructuresVoiceChannel2["default"], Constants: _Constants2["default"] }; -module.exports = exports["default"]; +module.exports = exports["default"]; \ No newline at end of file diff --git a/src/Structures/Message.js b/src/Structures/Message.js index 6852da24a..f98f7ab34 100644 --- a/src/Structures/Message.js +++ b/src/Structures/Message.js @@ -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)); diff --git a/src/Structures/PMChannel.js b/src/Structures/PMChannel.js index 4e0970891..e815431ed 100644 --- a/src/Structures/PMChannel.js +++ b/src/Structures/PMChannel.js @@ -27,8 +27,16 @@ 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)); + } } diff --git a/src/Structures/TextChannel.js b/src/Structures/TextChannel.js index 6d8e9d406..89a3a8b79 100644 --- a/src/Structures/TextChannel.js +++ b/src/Structures/TextChannel.js @@ -33,8 +33,16 @@ 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)); + } }