A package for posting, updating, and deleting Discord Application Commands from the command line or terminal.
It has a sync
command; which will post
to discord local commands not posted, update
to discord commands modified locally, and delete
from discord commands that doesn't exist locally.
It also offers manual post
and delete
command to accommodate special needs. To make manual operations more easier, the package also offers a compare
command that compares the status of commands locally and on Discord. Open CLI package main menu for list of commands.
Run npm install on the command line or terminal.
npm install @ming-suhi/djsc-cli
Create a config file on the project root with name djsc.config.js
.
module.exports = {
appId: "DISCORD_APPLICATION_ID",
botToken: "DISCORD_BOT_TOKEN",
mapCommands: () => {
// function that return array of JSON(raw-data) of local commands
}
}
For discord.js
builders, it has an inbuilt function for getting the raw-data of a command.
mapCommands: () => {
// Example for discord.js users
const commands = [];
const commandsDir = path.resolve("src/commands");
for(let filePath of fs.readdirSync(commandsDir)) {
const commandPath = path.resolve(commandsDir, filePath);
const command = require(commandPath);
commands.push(command.toJSON());
}
return commands;
}
mapCommands
is essential because it is through which that the cli package can sense the local commands.
To access the main menu of the cli tool, open a terminal inside the project directory and run npx djsc
or npx djsc help
.
npx djsc
This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue.
For help and questions about using this project, please open a GitHub issue.
-
Fork the project.
-
Create a topic branch from master.
-
Make some commits to improve the project.
-
Push this branch to your GitHub project.
-
Open a Pull Request on GitHub.
-
Discuss, and optionally continue committing.
MIT © 明suhi