Feature/66 add different commands per server (#122)
* Add ability for server exclusive commands * Add MankBot server-exclusive commands * Add lobby entity to database * Add documentation
This commit is contained in:
parent
6a00c49ef3
commit
1b1a070cfd
10 changed files with 247 additions and 135 deletions
31
docs/Registry.md
Normal file
31
docs/Registry.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Registry
|
||||
|
||||
The registry file is what is used to register the bot's commands and events. This is a script which is ran at startup and adds all the commands and events to the bot.
|
||||
|
||||
Although you can register these outside of the registry file, this script makes it a centralised place for it to be done at.
|
||||
|
||||
## Adding Commands
|
||||
|
||||
Commands are added in the `RegisterCommands` function.
|
||||
|
||||
The basic syntax is as follows:
|
||||
|
||||
```ts
|
||||
client.RegisterCommand("Name", new Command(), "ServerId");
|
||||
```
|
||||
|
||||
- `"Name"`: The name of the command, will be used by the user to call the command
|
||||
- `new Command()`: The command class to be executed, must inherit the Command class
|
||||
- `"ServerId"` (Optional): If given, will only be usable in that specific server
|
||||
|
||||
## Adding Events
|
||||
|
||||
Events are added in the `RegisterEvents` function.
|
||||
|
||||
The basic syntax is as follows:
|
||||
|
||||
```ts
|
||||
client.RegisterEvent(new Events());
|
||||
```
|
||||
|
||||
- `new Events()`: The event class to be executed
|
Loading…
Add table
Add a link
Reference in a new issue