mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Fixed self resolveDestination
Allows much better message sending from different methods, less bloaty
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user