Comments (3)
Hi,
I'm not sure if it was you or someone else, but someone did email me asking the same question. So I'll just copy my reply to that email to answer your question:
When running the help command, the only commands that are shown are the ones the user running the command has access to. Therefore, normal users do not see system commands when running this command. In the dashboard, the command list shows all commands.
While the bot doesn't have any built-in functionality to support hiding other commands, you are free to add this in if needed. The way I would do it is to add an property (for example, showInDashboard
) in the exports.help
function for each command and set this to true to show it, or false to hide it.
Let's say you want to hide the createinvite
command in the dashboard, you would set the exports.help
to something like:
exports.help = {
name: 'createinvite',
category: 'Moderation',
description: 'Creates an invite to the channel it is sent in. Example usage: `createinvite 1 5m` will create a single use invite valid for 5 mintues',
usage: 'createinvite [uses]\ncreateinvite [uses] [time (s/m/h/d)]',
showInDashboard: false
};
You would then add code into dashboard/templates/commands.ejs
to detect that showInDashboard
is false and then not add it. This should be the easiest part of it all. If you need the command also hidden in the help command (keep in mind that only the commands that a user has access to will be shown to them while running this command), you can repeat this process.
While I am always available for support, keep in mind that I offer the source code of the bot for free and am not obliged to provide support. It is also expected that people that change the bot try to understand the code and add to it before contacting me for additional assistance. Also note that changes to the bot may make support more difficult as I would not know about all of the changes.
from discordbot.
Thanks. I'll try to do what you said. And I only asked for help because I never used ejs before, and try to find the error with the method I tryed to use in the command.
from discordbot.
I've figured it out. First, I added showInDash: true in exports.conf in every command. Then I went to dashboard/templates/commands.ejs and added (Bold):
const help = {};
bot.commands.forEach((command) => {
const cat = command.help.category;
if (!help.hasOwnProperty(cat)) help[cat] = [];
if (command.conf.showInDash) {
help[cat].push(command);
}
});
And the help command I simpky deleted my method, because I haven't noticed the help command just show the commands the users are able to see with their permLevel.
from discordbot.
Related Issues (20)
- Bot Database HOT 4
- Music Commands HOT 2
- Error HOT 8
- Remove or Update URL Shortener Command HOT 2
- Stats page HOT 3
- How i host that in Glitch.com HOT 2
- Bot Dashboard HOT 7
- Bot leaves voise channel just after playing music HOT 3
- Login does not work HOT 2
- Uncaught Exception: TypeError: Cannot read property 'has' of undefined HOT 6
- Help command
- Getting an error for the `reason` command HOT 4
- [email protected] install: `prebuild-install || node-gyp rebuild` HOT 4
- [email protected] install: `prebuild-install || node-gyp rebuild` HOT 2
- Login redirects to broken URL HOT 3
- Invalid OAuth2 redirect_uri HOT 4
- Critical Vulnerability HOT 1
- Can't add more pages to the dashboard. HOT 1
- The End of NdT3's Discord Bot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discordbot.