#Code yielding

6 messages · Page 1 of 1 (latest)

ebon mural

Why is it not running past this line?

stone wagonBOT
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
ebon mural
const {promisify} = require("util");
const Ascil = require("ascii-table");
const {glob} = require("glob");
const PG = promisify(glob);

module.exports = async (client, PG, Ascii) => {
    const table = new Ascii("Buttons Hanlder");
    console.log(table.toString());
    const buttonsFolder = await PG(`${process.cwd()}/src/helper/buttons/**/*.js`);

    console.log(buttonsFolder);
    buttonsFolder.map(async (button) => {
        const buttonFile = require(button);

        console.log(button, buttonFile)
        if (!buttonFile.id) return;
        client.buttons.set(buttonFile.id, buttonFile);
        table.addRow(buttonFile.id, "✅");
    });

    console.log(table.toString());
};

The code does not run past

    const buttonsFolder = await PG(`${process.cwd()}/src/helper/buttons/**/*.js`);
celest basin

are you sure you don't have any errors

timid helm

isn't glob async already, why promisify it?

ebon mural