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

@@ -171,20 +171,10 @@ class TextBasedChannel {
messagePayload = await MessagePayload.create(this, options).resolveData();
}
let { data, files } = await messagePayload.resolveFiles();
let webembed = data.webembed;
delete data.webembed; //remove webembed
const { data, files } = await messagePayload.resolveFiles();
const d = await this.client.api.channels[this.id].messages.post({ data, files });
let d = await this.client.api.channels[this.id].messages.post({ data, files });
if (webembed) {
data.content = webembed;
const _d = await this.client.api.channels[this.id].messages.post({ data, files });
d.webembed = this.messages.cache.get(_d.id) ?? this.messages._add(_d);
}
return this.messages.cache.get(d.id) ?? this.messages._add(d); //webembed missing after cached.. ¯\_(ツ)_/¯
return this.messages.cache.get(d.id) ?? this.messages._add(d);
}
/**