Guh
This commit is contained in:
parent
f79185dc85
commit
ba9119c643
|
@ -20,9 +20,10 @@ const execute = async (interaction, db, client) => {
|
||||||
const attachments = [];
|
const attachments = [];
|
||||||
for (let i = 1; i <= 4; i++) {
|
for (let i = 1; i <= 4; i++) {
|
||||||
const attachment = interaction.options.getAttachment(`attachment${i}`);
|
const attachment = interaction.options.getAttachment(`attachment${i}`);
|
||||||
|
const fileExt = attachment.name ? path.extname(attachment.name) : '';
|
||||||
if (attachment) {
|
if (attachment) {
|
||||||
const url = attachment.url;
|
const url = attachment.url;
|
||||||
const filename = `${user.id}-${i}`;
|
const filename = `${user.id}-${i}${attachment}.${fileExt}`;
|
||||||
const filepath = path.join(__dirname, '../../storage', filename);
|
const filepath = path.join(__dirname, '../../storage', filename);
|
||||||
|
|
||||||
// Await the download before continuing
|
// Await the download before continuing
|
||||||
|
|
Loading…
Reference in a new issue