fix(expandMessage): check for webhookId correctly

This commit is contained in:
Ryan Cao 2023-05-14 17:50:56 +08:00
parent 8e279ae5cf
commit e451c1df4c
No known key found for this signature in database

View file

@ -20,7 +20,7 @@ function findFirstImage(message: Message): string | undefined {
}
export async function expandDiscordLink(message: Message): Promise<void> {
if (message.author.bot && !message.author.webhookId) return;
if (message.author.bot && !message.webhookId) return;
const re =
/(https?:\/\/)?(?:canary\.|ptb\.)?discord(?:app)?\.com\/channels\/(?<server_id>\d+)\/(?<channel_id>\d+)\/(?<message_id>\d+)/g;