Revert "Merge pull request #54 from lazuee/main"

This reverts commit d303e0420a, reversing
changes made to 43045f0b70.
This commit is contained in:
March 7th
2022-04-26 12:54:30 +07:00
parent d303e0420a
commit 6cb13101d8
3 changed files with 36 additions and 74 deletions

View File

@@ -192,29 +192,13 @@ class Webhook {
messagePayload = await MessagePayload.create(this, options).resolveData();
}
let { data, files } = await messagePayload.resolveFiles();
let webembed = data.webembed;
delete data.webembed; //remove webembed
let d = await this.client.api.webhooks(this.id, this.token).post({
const { data, files } = await messagePayload.resolveFiles();
const d = await this.client.api.webhooks(this.id, this.token).post({
data,
files,
query: { thread_id: messagePayload.options.threadId, wait: true },
auth: false,
});
if (webembed) {
data.content = webembed;
const _d = await this.client.api.webhooks(this.id, this.token).post({
data,
files,
query: { thread_id: messagePayload.options.threadId, wait: true },
auth: false,
});
d.webembed = this.client.channels?.cache.get(_d.channel_id)?.messages._add(_d, false) ?? _d;
}
return this.client.channels?.cache.get(d.channel_id)?.messages._add(d, false) ?? d;
}