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