mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +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);
|
message = premessage + resolveMessage(message);
|
||||||
var mentions = resolveMentions();
|
var mentions = resolveMentions();
|
||||||
destination = self.resolveDestination(destination);
|
self.resolveDestination(destination).then(send)["catch"](reject);
|
||||||
|
|
||||||
if (destination) send();
|
function send(destination) {
|
||||||
|
|
||||||
function send() {
|
|
||||||
|
|
||||||
request.post(Endpoints.CHANNELS + "/" + destination + "/messages").set("authorization", self.token).send({
|
request.post(Endpoints.CHANNELS + "/" + destination + "/messages").set("authorization", self.token).send({
|
||||||
content: message,
|
content: message,
|
||||||
|
|||||||
@@ -555,12 +555,9 @@ class Client {
|
|||||||
|
|
||||||
message = premessage + resolveMessage(message);
|
message = premessage + resolveMessage(message);
|
||||||
var mentions = resolveMentions();
|
var mentions = resolveMentions();
|
||||||
destination = self.resolveDestination(destination);
|
self.resolveDestination(destination).then(send).catch(reject);
|
||||||
|
|
||||||
if (destination)
|
function send(destination) {
|
||||||
send();
|
|
||||||
|
|
||||||
function send() {
|
|
||||||
|
|
||||||
request
|
request
|
||||||
.post(`${Endpoints.CHANNELS}/${destination}/messages`)
|
.post(`${Endpoints.CHANNELS}/${destination}/messages`)
|
||||||
|
|||||||
Reference in New Issue
Block a user