1
0
Fork 0

Can send attachment

Commando
Loic Bersier 6 years ago
parent f8ed83c85d
commit f917f09624

@ -17,14 +17,22 @@ module.exports = class dmCommand extends Command {
key: 'text',
prompt: 'Wich user would you like to dm?',
type: 'string',
default: ''
}
]
});
}
async run(message, { id, text }) {
let Attachment = (message.attachments).array();
const user = this.client.users.get(id);
user.send(`**Message from the dev**\n${text}`)
message.say('DM sent')
if (Attachment[0]) {
user.send(`**Message from the dev**\n${text}\n${Attachment[0].url}`)
message.say('DM sent')
}
else {
user.send(`**Message from the dev**\n${text}`)
message.say('DM sent')
}
}
};
Loading…
Cancel
Save