Skip to content

Commit

Permalink
better delivered log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhappyma committed Apr 29, 2024
1 parent 20d38b6 commit 817218c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/deliver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ bot.registerButton(/order:(\d+):complete/, async (interaction) => {
await clearKitchenMessages(order.id);
await interaction.deferReply({ ephemeral: true });

const isImage =
order.fileUrl?.endsWith(".png") ||
order.fileUrl?.endsWith(".jpg") ||
order.fileUrl?.endsWith(".jpeg") ||
order.fileUrl?.endsWith(".gif") ||
order.fileUrl?.endsWith(".webp");

if (order.statusMessageId)
updateOrderStatusMessage(
order.guildId,
Expand All @@ -221,6 +228,7 @@ bot.registerButton(/order:(\d+):complete/, async (interaction) => {
value: `<@!${order.deliveryId}>`,
},
]);
isImage ? deliveredEmbed.setImage(fileUrl(order.fileUrl!)!) : null;
await sendKitchenMessage(KitchenChannel.deliveredOrders, {
content: fileUrl(order.fileUrl!) ?? undefined,
embeds: [deliveredEmbed],
Expand Down

0 comments on commit 817218c

Please sign in to comment.