Skip to content
This repository was archived by the owner on Jan 25, 2021. It is now read-only.

Commit 17e253d

Browse files
committed
Updates setting-a-default-value-for-an-arg.md
Auto commit by GitBook Editor
1 parent 45a93e9 commit 17e253d

17 files changed

+50
-36
lines changed

SUMMARY.md

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
11
# Summary
22

3+
## Starting
4+
35
* [Introduction](README.md)
46
* [Getting Started](getting-started.md)
5-
* [Making Your First Command](making-your-first-command.md)
6-
* [Adding More Command Groups](adding-more-command-groups.md)
7-
* [Using Args in Commands](using-args-in-commands.md)
8-
* [Using Multiple Args in One Command](using-multiple-args-in-one-command.md)
9-
* [Using a Validator for an Arg](using-a-validator-for-an-arg.md)
10-
* [Using Aliases in Commands](using-aliases-in-commands.md)
11-
* [Using Throttling in Commands](using-throttling-in-commands.md)
12-
* [Setting a Default Value for an Arg](setting-a-default-value-for-an-arg.md)
13-
* [Using Client Values in a Command](using-client-values-in-a-command.md)
14-
* [Using a RichEmbed in a Command](using-a-richembed-in-a-command.md)
15-
* [Setting a Command to Guild Only](setting-a-command-to-guild-only.md)
16-
* [Checking for Client Permissions](checking-for-permissions.md)
17-
* [Checking for User Permissions](checking-for-user-permissions.md)
18-
* [Using an async run Method](using-an-async-run-method.md)
19-
* [Removing the Unknown Command Response](removing-the-unknown-command-response.md)
20-
* [Setting a Database Provider](setting-a-database-provider.md)
7+
8+
## Commands & Groups
9+
10+
* [First Command](making-your-first-command.md)
11+
* [Adding Groups](adding-more-command-groups.md)
12+
* [Guild Only](setting-a-command-to-guild-only.md)
13+
* [async run Method](using-an-async-run-method.md)
14+
* [Client Permissions](checking-for-permissions.md)
15+
* [User Permissions](checking-for-user-permissions.md)
16+
17+
## Args
18+
19+
* [Args](using-args-in-commands.md)
20+
* [Multiple Args](using-multiple-args-in-one-command.md)
21+
* [Validators](using-a-validator-for-an-arg.md)
22+
* [Aliases](using-aliases-in-commands.md)
23+
* [Throttling](using-throttling-in-commands.md)
24+
* [Default](setting-a-default-value-for-an-arg.md)
25+
26+
## Settings
27+
28+
* [Settings Provider](setting-a-database-provider.md)
29+
30+
## Other Stuff
31+
32+
* [Client Values](using-client-values-in-a-command.md)
33+
* [RichEmbeds](using-a-richembed-in-a-command.md)
34+
* [Unknown Command Response Removal](removing-the-unknown-command-response.md)
2135

adding-more-command-groups.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Adding More Command Groups
1+
# Adding Groups
22

33
Before we make our new argument-powered command, I think we should place it within it's own command group. Then, we can have multiple commands sorted separately in our help command and folder structure.
44

@@ -29,9 +29,9 @@ client.registry
2929
.registerCommandsIn(path.join(__dirname, 'commands'));
3030
```
3131

32-
You can add as many of these as you want.
32+
You can add as many of these as you want.
3333

3434
The next step is to create another folder in your `commands` folder, called `group2`, just like with our `group1` folder.
3535

36-
And there you go, another command group for our new command!
36+
And there you go, another command group for our new command!
3737

checking-for-permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Checking for Client Permissions
1+
# Client Permissions
22

33
Sometimes you're going to have a command and start getting a `Forbidden` error. Why? Well, most likely you don't have permissions in the guild to do something. Commando will automatically check for the Send Messages permission and reroute the command to a DM, but for things like Embed Links or Manage Messages you may want to perform a permission check before using the command. Thankfully, this is quite simple.
44

checking-for-user-permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Checking for User Permissions
1+
# User Permissions
22

33
In the last chapter we talked about how to check for bot permissions, in this chapter, we're going to be using a `hasPermission` method to check whether or not the user is the owner before using the command.
44

making-your-first-command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Making Your First Command
1+
# First Command
22

33
So now that we've set up a command group and registered our command folder, we're ready to make our first command file! First, you're going to need to, of course, create a new file for the command. Hop over to your `commands` folder, and then your `group1` folder, and make a new file called `reply.js`. This is going to be a simple command that only replies with a message when used. We'll go into arguments and all that later.
44

removing-the-unknown-command-response.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Removing the Unknown Command Response
1+
# Unknown Command Response Removal
22

33
Sometimes, you may want to remove the \(somewhat annoying\) unknown command response from your bot. Be it Cleverbot or other reason, sometimes you just want it gone, and it's quite simple to remove.
44

setting-a-command-to-guild-only.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Setting a Command to Guild Only
1+
# Guild Only
22

33
You may have noticed that should you use your say command in a DM, you are going to get a `Forbidden` error due to attempting to delete a message from the other user in DM. One easy way around this? Setting the command to guild only!
44

setting-a-database-provider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Setting a Database Provider
1+
# Settings Provider
22

33
Commando has a built-in way of storing guild settings. By default things such as the guild's custom prefix or disabled commands will be stored for Data Persistence, and you can also have your own custom settings as well.
44

setting-a-default-value-for-an-arg.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Setting a Default Value for an Arg
1+
# Default
22

3-
Sometimes you may want an argument to be optional. In that case, you can use `default`.
3+
Sometimes you may want an argument to be optional. In that case, you can use `default`.
44

55
Let's say you have a command that rolls a dice, it's args would probably looking something like this:
66

@@ -27,7 +27,7 @@ args: [
2727
]
2828
```
2929

30-
And then it will be 6 if no argument is set.
30+
And then it will be 6 if no argument is set.
3131

3232
You can take advantage of this to create completely optional arguments, for example:
3333

using-a-richembed-in-a-command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Using a RichEmbed in a Command
1+
# RichEmbeds
22

33
You may have noticed that if you try to use a RichEmbed in your command, that there's no way to create the new embed, as `new Discord.RichEmbed()` is going to say `Discord` is undefined. That's because when using a RichEmbed, we need to require Discord.js alongside Commando.
44

using-a-validator-for-an-arg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Using a Validator for an Arg
1+
# Validators
22

33
Sometimes you're going to want an argument to be a certain thing, for example, a certain text, or maybe you want to check the length, there's many things you may want to do. This can be accomplished with a `validate` in your arg.
44

using-aliases-in-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Using Aliases in Commands
1+
# Aliases
22

33
Aliases are simply different ways to call the same command. They're extremely simple to do.
44

using-an-async-run-method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Using an async run Method
1+
# async run Method
22

33
`async` is a simple way to make your Promise-Powered code look _extremely_ neat. Normally with promises, we would use `.then` to continue running the command after the promise has resolved.
44

using-args-in-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Using Args in Commands
1+
# Args
22

33
Sometimes when using commands we may want to get data from our user to narrow down the command further. In this section we'll create a command that pulls a string from the message and says it back to the user.
44

using-client-values-in-a-command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Using Client Values in a Command
1+
# Client Values
22

33
This one is easy. Say you wanted to use a client value in your command, for example, you wanted to get the amount of guilds the bot was in. Normally, you'd do this:
44

using-multiple-args-in-one-command.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Using Multiple Args in One Command
1+
# Multiple Args
22

33
Sometimes you may want to collect more than one piece of content from a message. Well, you're in luck, as Commando makes using multiple Arguments very simple.
44

using-throttling-in-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Using Throttling in Commands
1+
# Throttling
22

33
Throttling is like rate-limiting, it only allows the command to be used in a certain period of time. A cooldown of sorts. They're very simple, as with most things I've explained in Commando.
44

0 commit comments

Comments
 (0)