Compare commits

..

No commits in common. "e47043317cee85e9443e5a0138b460034588abe9" and "bf97b3633f4646004a880f8d6a06c6c57ed24ae1" have entirely different histories.

View file

@ -7,6 +7,7 @@ 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())
@ -19,13 +20,6 @@ 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://)")
@ -33,7 +27,6 @@ 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) {