Add the ability to reply to images with tdoss command
All checks were successful
CI / CI (push) Successful in 1m28s

This commit is contained in:
SileNce5k 2025-04-11 00:02:07 +02:00
parent 4c1199aea5
commit e47043317c
Signed by: SileNce
GPG key ID: B0A142BB4291B204

View file

@ -19,6 +19,13 @@ module.exports = {
} else if(args[0] && args[0].startsWith("https://") ){ } else if(args[0] && args[0].startsWith("https://") ){
url = args[0]; 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 { 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://)") 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://)")