From 4c1199aea55c659afc7d078f31dc162f25c3ec1c Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 11 Apr 2025 00:00:06 +0200 Subject: [PATCH 1/2] Only start typing when heavy work begins I found that if I start at the beginning, if the command failed early, it'd still be typing a couple seconds after replying to your command, which was kind of annoying. --- commands/misc/tdoss.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/misc/tdoss.js b/commands/misc/tdoss.js index 2419100..61cf409 100644 --- a/commands/misc/tdoss.js +++ b/commands/misc/tdoss.js @@ -7,7 +7,6 @@ module.exports = { name: 'tdoss', description: 'Combine picture with tdoss album cover template', async execute({ message, args }) { - message.channel.sendTyping(); let dataDir = path.resolve(__dirname, '..', '..', 'data'); const directory = path.resolve(dataDir, Math.floor(new Date).toString()) @@ -27,6 +26,7 @@ module.exports = { return } // TODO: Download with correct extension. + message.channel.sendTyping(); const curlCommand = `curl "${url}" -o ${directory}/input.png`; if (this.executeCommand(curlCommand).error === true) { From e47043317cee85e9443e5a0138b460034588abe9 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 11 Apr 2025 00:02:07 +0200 Subject: [PATCH 2/2] Add the ability to reply to images with tdoss command --- commands/misc/tdoss.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/commands/misc/tdoss.js b/commands/misc/tdoss.js index 61cf409..4f45614 100644 --- a/commands/misc/tdoss.js +++ b/commands/misc/tdoss.js @@ -19,6 +19,13 @@ module.exports = { } else if(args[0] && args[0].startsWith("https://") ){ url = args[0]; + }else if(message.reference){ + let referencedMessage = await message.fetchReference(); + if(referencedMessage.attachments.size > 0) + url = await referencedMessage.attachments.first().url; + else { + message.channel.send("The message you replied to doesn't have any attachments."); + } } else { message.channel.send("You have to provide an image to use this command.\nEither via an attachment or via a link (must be the first argument and start with https://)")