Skip to content

Commit 1dc7784

Browse files
committed
2 parents 7471f2e + 2aea607 commit 1dc7784

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/events/attachment/create.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,21 @@ export const event: EventFunction = {
1313
attachment: cutoffText(data.attachment.name, 50)
1414
}),
1515
description: data.embedDescription(['attachment', 'card', 'list']),
16-
image: data.attachment.url && data.attachment.url.startsWith(IMAGE_ATTACHMENT_HOST) ? { url: data.attachment.url } : null
16+
image:
17+
data.attachment.url && data.attachment.url.startsWith(IMAGE_ATTACHMENT_HOST)
18+
? { url: data.attachment.url }
19+
: null
1720
},
1821
small: {
1922
description: _('webhooks.attach_card', {
2023
member: `[${data.invoker.webhookSafeName}](https://trello.com/${data.invoker.username})`,
2124
card: `[${cutoffText(data.card.name, 25)}](https://trello.com/c/${data.card.shortLink})`,
2225
attachment: cutoffText(data.attachment.name, 25)
2326
}),
24-
thumbnail: data.attachment.url && data.attachment.url.startsWith(IMAGE_ATTACHMENT_HOST) ? { url: data.attachment.url } : null
27+
thumbnail:
28+
data.attachment.url && data.attachment.url.startsWith(IMAGE_ATTACHMENT_HOST)
29+
? { url: data.attachment.url }
30+
: null
2531
}
2632
});
2733
}

src/util/webhookData.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,10 @@ export default class WebhookData {
448448
{ where: { id: this.webhook.id } }
449449
);
450450
} else if (e.code === 50027) {
451-
logger.warn(`Discord webhook token invalid, dropping @ ${this.webhook.webhookID}:${this.webhook.id}`, e);
451+
logger.warn(
452+
`Discord webhook token invalid, dropping @ ${this.webhook.webhookID}:${this.webhook.id}`,
453+
e
454+
);
452455
await Webhook.update(
453456
{
454457
webhookID: null,
@@ -457,12 +460,16 @@ export default class WebhookData {
457460
{ where: { id: this.webhook.id } }
458461
);
459462
} else if (e.status === 400) {
460-
logger.error(`Invalid form body, dropping @ ${this.webhook.webhookID}:${this.webhook.id} - ${this.filterFlag}`, e);
463+
logger.error(
464+
`Invalid form body, dropping @ ${this.webhook.webhookID}:${this.webhook.id} - ${this.filterFlag}`,
465+
e
466+
);
461467
} else {
462468
attempt++;
463469
if (attempt > 3) {
464470
logger.error(
465-
`Discord Error ${e.code} (${e.status}), exceeded attempts, dropping @ ${this.webhook.webhookID}:${this.webhook.id}`, e
471+
`Discord Error ${e.code} (${e.status}), exceeded attempts, dropping @ ${this.webhook.webhookID}:${this.webhook.id}`,
472+
e
466473
);
467474
} else {
468475
logger.warn(

0 commit comments

Comments
 (0)