feat(Interactions): add InteractionWebhook for better internals (#5712)

This commit is contained in:
ckohen
2021-06-05 16:41:23 -07:00
committed by GitHub
parent 1d57754d46
commit dec191aa1e
9 changed files with 120 additions and 36 deletions

View File

@@ -325,7 +325,7 @@ class Webhook {
return this.client.rest.cdn.Avatar(this.id, this.avatar, format, size);
}
static applyToClass(structure) {
static applyToClass(structure, ignore = []) {
for (const prop of [
'send',
'sendSlackMessage',
@@ -338,6 +338,7 @@ class Webhook {
'createdAt',
'url',
]) {
if (ignore.includes(prop)) continue;
Object.defineProperty(structure.prototype, prop, Object.getOwnPropertyDescriptor(Webhook.prototype, prop));
}
}