diff --git a/adapters/discord/src/message.ts b/adapters/discord/src/message.ts index 3fae6dce..b3231b1e 100644 --- a/adapters/discord/src/message.ts +++ b/adapters/discord/src/message.ts @@ -116,7 +116,7 @@ export class DiscordMessageEncoder extends MessageEncoder { return this.post({ ...addition, content: attrs.url }) } - if (this.bot.http.isPrivate(attrs.url)) { + if (await this.bot.http.isPrivate(attrs.url)) { return await this.sendEmbed(attrs, addition) } diff --git a/adapters/kook/src/message.ts b/adapters/kook/src/message.ts index 383b5811..a44a4db2 100644 --- a/adapters/kook/src/message.ts +++ b/adapters/kook/src/message.ts @@ -42,7 +42,7 @@ export class KookMessageEncoder extends MessageEncoder { } private async transformUrl({ type, attrs }: h) { - if (this.bot.http.isPrivate(attrs.url)) { + if (await this.bot.http.isPrivate(attrs.url)) { const payload = new FormData() const result = await this.bot.ctx.http.file(attrs.url, attrs) payload.append('file', Buffer.from(result.data), { diff --git a/packages/axios/src/index.ts b/packages/axios/src/index.ts index e7bf9c89..d27a629a 100644 --- a/packages/axios/src/index.ts +++ b/packages/axios/src/index.ts @@ -128,7 +128,7 @@ export class Quester { } async toPublic(url: string) { - if (!this.isPrivate(url)) return url + if (!await this.isPrivate(url)) return url const { headers, data } = await this.axios(url, { method: 'GET', responseType: 'arraybuffer',