feat: requested changes

This commit is contained in:
Jacob Nguyen
2022-07-12 14:28:07 -05:00
parent c2e1028bc8
commit 9cfb202014
4 changed files with 11 additions and 46 deletions

View File

@@ -1,11 +1,11 @@
# Introduction
Welcome to sern's official guide. This guide will go through all the core features of the framework.
Thank you for choosing sern!
- 💖 Thank you for choosing sern to be your framework!
- Teaching the discord.js library and / or Javascript / Typescript is out of scope of this project, so the documentation assumes you already know these elements.
- Teaching the discord.js library and / or Javascript / Typescript is out of scope of this project, so the documentation assumes you already know these elements.
- discord.js@dev is the only supported version at the moment. There are plans to roll out a version of sern in discord.js@13.xx.xx in the future.
- discord.js@dev is the only supported version at the moment. There are plans to roll out a version of sern in discord.js@13.xx.xx in the future.
## You will learn
* [sern's goal](walkthrough/goal.md)

View File

@@ -30,33 +30,12 @@ exports.default = commandModule({
},
})
```
### Essential properties of a command
- **module.type** (Required)
- The type of your module. For example, a command listening to messages would have the type CommandType.Text
- **module.execute** (Required)
- This function is called when the command is triggered. Do your logic here!
- **module.name** (Optional)
- Give your command a name. **(defaults to its filename)**
- **module.description** (Optional)
- Give your command a description. **(defaults to `..`)**
- **module.plugins** (Optional)
- A list of [plugins](plugins.md) that will modify and change the behavior of your command. <br>
To view what each of these properties mean in depth, visit the [official documentation](https://sern-handler.js.org/docs).
### Types of command modules
Every command module `type` is part of an enum. This field allows type inference for the rest of a module's fields. <br>
All available command types :
```
CommandType.Text = A Text Command
CommandType.Slash = A Slash Command
CommandType.Both = A Command supporting either text or slash
CommandType.Modal = A Command listening to Modal interactions
CommandType.MenuSelect = A Command listening to select menu interactions
CommandType.MenuUser = A Command listening to context menu user interactions
CommandType.MenuMsg = A Command listening to context menu message interactions
CommandType.Button = A Command listening to button interactions
```
So, lets say you want to make a command module that listens to modals. <br>
All the command types can be found in the [official documentation](https://sern-handler.js.org/docs)!
<p>So, lets say you want to make a command module that listens to modals. </p>
**Note**: Keep in mind you'll need to send a modal with a custom id `dm-me`. This example below is the response to a modal being sent.<br>
Typescript:

View File

@@ -22,24 +22,10 @@ exports.default = eventModule({
}
})
```
Like command modules, the `type` property denotes what kind of event it is.
```
EventType.Sern = an event listening to the SernEmitter
EventType.Discord = an event listening to the discord.js Client
EventType.External = an event listening to any class extending an EventEmitter
```
### Essential properties of an event module
Like command modules, the `type` property denotes what kind of event it is, which
can be found [here](https://sern-handler.js.org/docs).
- **module.type** (Required)
- The type of your module. ( Check previous message ^^^)
- **module.execute** (Required)
- This function is called when the event module is triggered. Do your logic here!
- **module.name** (Optional)
- The name of the event. **(defaults to its filename, however it is recommended to fill this out!!)**
- **module.description** (Optional)
- Give your command a description. **(defaults to `..`)**
- **module.plugins** (Optional)
- A list of [plugins](plugins.md) that will modify and change the behavior of your command. <br>
To view what each of these properties mean in depth, visit the [official documentation](https://sern-handler.js.org/docs).
<br>
Event modules are laid out similarly to command modules. These listen to any and all event you provide.

View File

@@ -1,6 +1,6 @@
# Goal
Sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools
sern strives to be minimalist, but with all batteries included. Meaning, this framework provides the necessary tools
to start up a bot in minutes, and leaves plenty room space to customize your experience and create an amazing project.
It should include all the tools for any bot at any scale.