Fixed self resolveDestination

Allows much better message sending from different methods, less bloaty
This commit is contained in:
hydrabolt
2015-08-26 13:05:13 +01:00
parent 2971eccbd2
commit 669c379a62
2 changed files with 4 additions and 9 deletions

View File

@@ -543,11 +543,9 @@ var Client = (function () {
message = premessage + resolveMessage(message);
var mentions = resolveMentions();
destination = self.resolveDestination(destination);
self.resolveDestination(destination).then(send)["catch"](reject);
if (destination) send();
function send() {
function send(destination) {
request.post(Endpoints.CHANNELS + "/" + destination + "/messages").set("authorization", self.token).send({
content: message,

View File

@@ -555,12 +555,9 @@ class Client {
message = premessage + resolveMessage(message);
var mentions = resolveMentions();
destination = self.resolveDestination(destination);
self.resolveDestination(destination).then(send).catch(reject);
if (destination)
send();
function send() {
function send(destination) {
request
.post(`${Endpoints.CHANNELS}/${destination}/messages`)