mirror of
https://github.com/danbulant/discord.js
synced 2026-07-09 05:00:48 +00:00
Added error resolving
This commit is contained in:
parent
8de0199bf5
commit
206f8cfe1f
2 changed files with 30 additions and 9 deletions
|
|
@ -545,6 +545,17 @@ var Client = (function () {
|
||||||
} else {
|
} else {
|
||||||
fstream = file;
|
fstream = file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.resolveDestination(destination).then(send)["catch"](error);
|
||||||
|
|
||||||
|
function send(destination) {
|
||||||
|
request.post(Endpoints.CHANNELS + "/" + destination + "/messages");
|
||||||
|
}
|
||||||
|
|
||||||
|
function error(err) {
|
||||||
|
callback(err);
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
|
|
||||||
|
|
@ -558,7 +558,17 @@ class Client {
|
||||||
fstream = file;
|
fstream = file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.resolveDestination(destination).then(send).catch(error);
|
||||||
|
|
||||||
|
function send(destination) {
|
||||||
|
request
|
||||||
|
.post(`${Endpoints.CHANNELS}/${destination}/messages`)
|
||||||
|
}
|
||||||
|
|
||||||
|
function error(err){
|
||||||
|
callback(err);
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue