mirror of
https://github.com/artiemis/artemis.js.git
synced 2026-02-14 10:21:54 +00:00
handle embed thumbnails
This commit is contained in:
parent
2834e21038
commit
52b54aff28
@ -75,6 +75,7 @@ export async function ocrImpl(url: string) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!type?.mime.startsWith("image/")) {
|
if (!type?.mime.startsWith("image/")) {
|
||||||
|
console.log(type, url);
|
||||||
abort("The file must be an image!");
|
abort("The file must be an image!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,9 +12,12 @@ export default defineCommand({
|
|||||||
if (!interaction.isMessageContextMenuCommand()) return;
|
if (!interaction.isMessageContextMenuCommand()) return;
|
||||||
|
|
||||||
const attachment = interaction.targetMessage.attachments.first();
|
const attachment = interaction.targetMessage.attachments.first();
|
||||||
|
const embed = interaction.targetMessage.embeds[0];
|
||||||
|
|
||||||
const imageUrl = getImageFromAttachmentOrString(
|
const imageUrl = getImageFromAttachmentOrString(
|
||||||
attachment,
|
attachment,
|
||||||
interaction.targetMessage.embeds[0]?.image?.url ||
|
embed?.image?.url ||
|
||||||
|
embed?.thumbnail?.url ||
|
||||||
interaction.targetMessage.content
|
interaction.targetMessage.content
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -13,9 +13,12 @@ export default defineCommand({
|
|||||||
if (!interaction.isMessageContextMenuCommand()) return;
|
if (!interaction.isMessageContextMenuCommand()) return;
|
||||||
|
|
||||||
const attachment = interaction.targetMessage.attachments.first();
|
const attachment = interaction.targetMessage.attachments.first();
|
||||||
|
const embed = interaction.targetMessage.embeds[0];
|
||||||
|
|
||||||
const imageUrl = getImageFromAttachmentOrString(
|
const imageUrl = getImageFromAttachmentOrString(
|
||||||
attachment,
|
attachment,
|
||||||
interaction.targetMessage.embeds[0]?.image?.url ||
|
embed?.image?.url ||
|
||||||
|
embed?.thumbnail?.url ||
|
||||||
interaction.targetMessage.content
|
interaction.targetMessage.content
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -16,9 +16,12 @@ export default defineCommand({
|
|||||||
if (!interaction.isMessageContextMenuCommand()) return;
|
if (!interaction.isMessageContextMenuCommand()) return;
|
||||||
|
|
||||||
const attachment = interaction.targetMessage.attachments.first();
|
const attachment = interaction.targetMessage.attachments.first();
|
||||||
|
const embed = interaction.targetMessage.embeds[0];
|
||||||
|
|
||||||
const imageUrl = getImageFromAttachmentOrString(
|
const imageUrl = getImageFromAttachmentOrString(
|
||||||
attachment,
|
attachment,
|
||||||
interaction.targetMessage.embeds[0]?.image?.url ||
|
embed?.image?.url ||
|
||||||
|
embed?.thumbnail?.url ||
|
||||||
interaction.targetMessage.content
|
interaction.targetMessage.content
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user