Add files via upload

This commit is contained in:
2021-08-18 00:12:37 -07:00
committed by GitHub
parent ecd6246099
commit 9d759573d2
55 changed files with 3098 additions and 0 deletions

View File

@ -0,0 +1,17 @@
const fs = require('fs');
module.exports = {
command: 'df',
description: 'Delete a file from your webserver (https://{domain}/{fileName})',
syntax: '{PREFIX}df [fileName]',
execute: async (_this, msg, args) => {
if (!args.join(' ')) return msg.channel.createMessage('No arguments were given');
const fileName = args.join(' ');
const filesDir = `${__dirname}/../../server/uploads`;
fs.unlink(`${filesDir}/${fileName}`, err => {
err
? msg.channel.createMessage(`Error deleting file: ${fileName}\n${err}`)
: msg.channel.createMessage(`Successfully Deleted File: ${fileName}`);
});
},
};