Only start typing when heavy work begins
Some checks failed
CI / CI (push) Has been cancelled

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.
This commit is contained in:
SileNce5k 2025-04-11 00:00:06 +02:00
parent bf97b3633f
commit 4c1199aea5
Signed by: SileNce
GPG key ID: B0A142BB4291B204

View file

@ -7,7 +7,6 @@ module.exports = {
name: 'tdoss', name: 'tdoss',
description: 'Combine picture with tdoss album cover template', description: 'Combine picture with tdoss album cover template',
async execute({ message, args }) { async execute({ message, args }) {
message.channel.sendTyping();
let dataDir = path.resolve(__dirname, '..', '..', 'data'); let dataDir = path.resolve(__dirname, '..', '..', 'data');
const directory = path.resolve(dataDir, Math.floor(new Date).toString()) const directory = path.resolve(dataDir, Math.floor(new Date).toString())
@ -27,6 +26,7 @@ module.exports = {
return return
} }
// TODO: Download with correct extension. // TODO: Download with correct extension.
message.channel.sendTyping();
const curlCommand = `curl "${url}" -o ${directory}/input.png`; const curlCommand = `curl "${url}" -o ${directory}/input.png`;
if (this.executeCommand(curlCommand).error === true) { if (this.executeCommand(curlCommand).error === true) {