diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml deleted file mode 100644 index bc3fc5c..0000000 --- a/.github/workflows/deploy-docs.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: deploy-docs -on: - push: - branches: - - master - pull_request: - types: [opened, reopened] - branches: - - master -permissions: - contents: write -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install mkdocs mkdocs-material - pip install "mkdocs-material[imaging]" - - name: Deploy to GitHub Pages - run: | - mkdocs gh-deploy --force diff --git a/.github/workflows/publish-release.yml b/.github/workflows/release.yml similarity index 88% rename from .github/workflows/publish-release.yml rename to .github/workflows/release.yml index 4b73110..70355ee 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Create and Publish Release +name: Release and Deploy on: push: branches: @@ -45,13 +45,13 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: "lts/*" - - name: Configure npm authentication - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN_AUTOMATION }}" > ~/.npmrc + node-version: "20" + registry-url: https://registry.npmjs.org - name: Publish package run: npm ci && npm publish - deploy: + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + deploy-docs: runs-on: ubuntu-latest needs: publish-package steps: diff --git a/docs/builtIn/help-command.md b/docs/builtIn/help-command.md index 5338d45..d0ef51a 100644 --- a/docs/builtIn/help-command.md +++ b/docs/builtIn/help-command.md @@ -65,9 +65,6 @@ module.exports = { return message.reply(response).catch((error) => console.log(error)); } }, - /** - * Missing data property if you plan to turn this into a slash command! - */ async execute(interaction, client, level) { await interaction.deferReply({ ephemeral: true, @@ -118,9 +115,7 @@ module.exports = { content: "An error occurred while processing your request.", ephemeral: true, }) - .catch((e) => { - - }); + .catch(() => {}); } }, }; @@ -311,21 +306,21 @@ const getSingleCmd = async (commands, name, client) => { const fieldObj = []; fieldObj.push({ name: `Category:`, - value: `${command.category}`, + value: `${slashCommand.category}`, inline: true, }); fieldObj.push({ name: `Usage:`, - value: `/${command.name}`, + value: `/${slashCommand.name}`, inline: true, }); - if (command.executePrefix) { + if (slashCommand.executePrefix) { fieldObj.push({ name: `Using prefix:`, - value: `${prefix}${command.name} ${command.usage}${ - command.aliases - ? `, ${prefix}${command.aliases.join(`, ${prefix}`)}` + value: `${prefix}${slashCommand.name} ${slashCommand.usage}${ + slashCommand.aliases + ? `, ${prefix}${slashCommand.aliases.join(`, ${prefix}`)}` : "" }`, }); @@ -336,8 +331,8 @@ const getSingleCmd = async (commands, name, client) => { name: `${client.user.tag}`, iconURL: `${client.user.avatarURL()}`, }) - .setTitle(`${command.data.name.toProperCase()} Command`) - .setDescription(command.data.description) + .setTitle(`${slashCommand.data.name.toProperCase()} Command`) + .setDescription(slashCommand.data.description) .setTimestamp() .setFields(fieldObj); @@ -394,5 +389,4 @@ const getSingleCmd = async (commands, name, client) => { }; } }; - ``` diff --git a/package-lock.json b/package-lock.json index 315c4f5..01cc032 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "discord-features-handler", - "version": "3.1.1", + "version": "3.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "discord-features-handler", - "version": "3.1.1", + "version": "3.1.2", "license": "MIT", "dependencies": { "discord.js": "^14.21.0" diff --git a/package.json b/package.json index 621f56e..966540e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord-features-handler", - "version": "3.1.1", + "version": "3.1.2", "description": "An simple discord regular and slash commands, events and modules handler with folder structure", "main": "src/index.js", "types": "src/index.d.ts", diff --git a/src/commands/miscellaneous/dfhHelp.js b/src/commands/miscellaneous/dfhHelp.js index 05f63f9..e9e5a87 100644 --- a/src/commands/miscellaneous/dfhHelp.js +++ b/src/commands/miscellaneous/dfhHelp.js @@ -296,21 +296,21 @@ const getSingleCmd = async (commands, name, client) => { const fieldObj = []; fieldObj.push({ name: `Category:`, - value: `${command.category}`, + value: `${slashCommand.category}`, inline: true, }); fieldObj.push({ name: `Usage:`, - value: `/${command.name}`, + value: `/${slashCommand.name}`, inline: true, }); - if (command.executePrefix) { + if (slashCommand.executePrefix) { fieldObj.push({ name: `Using prefix:`, - value: `${prefix}${command.name} ${command.usage}${ - command.aliases - ? `, ${prefix}${command.aliases.join(`, ${prefix}`)}` + value: `${prefix}${slashCommand.name} ${slashCommand.usage}${ + slashCommand.aliases + ? `, ${prefix}${slashCommand.aliases.join(`, ${prefix}`)}` : "" }`, }); @@ -321,8 +321,8 @@ const getSingleCmd = async (commands, name, client) => { name: `${client.user.tag}`, iconURL: `${client.user.avatarURL()}`, }) - .setTitle(`${command.data.name.toProperCase()} Command`) - .setDescription(command.data.description) + .setTitle(`${slashCommand.data.name.toProperCase()} Command`) + .setDescription(slashCommand.data.description) .setTimestamp() .setFields(fieldObj); diff --git a/src/handlers/loadCommands.js b/src/handlers/loadCommands.js index 103f870..c9af697 100644 --- a/src/handlers/loadCommands.js +++ b/src/handlers/loadCommands.js @@ -140,10 +140,9 @@ module.exports = ({ client.commands.forEach((cmd) => { if ("data" in cmd && ("interactionReply" in cmd || "execute" in cmd)) { + slashCommands.push(cmd.data.toJSON()); if ("global" in cmd && cmd.global === true) { globalSlashCommands.push(cmd.data.toJSON()); - } else { - slashCommands.push(cmd.data.toJSON()); } } });