This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Webhook, MessageBuilder } from 'discord-webhook-node'; | |
const hook = new Webhook("DISCORD WEBHOOK HERE"); // Change this to your webhook. (this is a example url, it doesn't work) | |
import { Command } from "commander"; | |
const program = new Command(); | |
program.option("-n, --name <string>"); // You can add more options here following the same format. | |
program.option("-z, --size <string>"); | |
program.option("-f, --path <string>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//requiring path and fs modules | |
const path = require("path"); | |
const fs = require("fs"); | |
//joining path of directory | |
const directoryPath = path.join(__dirname, "/"); | |
//passsing directoryPath and callback function | |
fs.readdir(directoryPath, function (err, files) { | |
//handling error | |
if (err) { | |
return console.log("Unable to scan directory: " + err); |