mirror of
https://github.com/sern-handler/website
synced 2026-06-28 02:32:23 +00:00
20
.gitignore
vendored
Normal file
20
.gitignore
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# Dependencies
|
||||
/node_modules
|
||||
|
||||
# Production
|
||||
/build
|
||||
|
||||
# Generated files
|
||||
.docusaurus
|
||||
.cache-loader
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
7
.idea/discord.xml
generated
Normal file
7
.idea/discord.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="PROJECT_FILES" />
|
||||
<option name="description" value="" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/misc.xml
generated
Normal file
6
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/website.iml" filepath="$PROJECT_DIR$/.idea/website.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
9
.idea/website.iml
generated
Normal file
9
.idea/website.iml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
12
.vscode/settings.json
vendored
Normal file
12
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/Thumbs.db": true,
|
||||
".idea": true,
|
||||
".vscode": true
|
||||
}
|
||||
}
|
||||
15
_blog/_2021-08-01-mdx-blog-post.mdx
Normal file
15
_blog/_2021-08-01-mdx-blog-post.mdx
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
slug: the-why-in-everything
|
||||
title: why
|
||||
authors: [jacoobes]
|
||||
tags: []
|
||||
---
|
||||
|
||||
Yes, yet another discord.js handler.
|
||||
|
||||
<br/> Why?
|
||||
<br/> Why??
|
||||
|
||||
<br />
|
||||
There are so many discord.js handlers out there. So why another one? Here's the thing. Most handlers you see out there are
|
||||
poorly made, not maintained, unknown bugs, or who knows what.
|
||||
5
_blog/authors.yml
Normal file
5
_blog/authors.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
jacoobes:
|
||||
name: jacoobes
|
||||
title: Head Dev
|
||||
url: https://github.com/jacoobes
|
||||
image_url: https://github.com/jacoobes.png
|
||||
@@ -11395,7 +11395,7 @@ section {
|
||||
|
||||
.device[data-device=iPhoneX][data-orientation=portrait][data-color=black]::after {
|
||||
content: "";
|
||||
background-image: url("../assets/img/portrait_black.png");
|
||||
background-image: url("../assets/images/portrait_black.png");
|
||||
}
|
||||
|
||||
.device[data-device=iPhoneX][data-orientation=portrait][data-color=black] .button {
|
||||
@@ -11530,14 +11530,14 @@ section.cta:before {
|
||||
max-width: 17rem;
|
||||
}
|
||||
}
|
||||
footer a {
|
||||
/* footer a {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
text-decoration: none;
|
||||
}
|
||||
footer a:hover, footer a:active, footer a:focus {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
text-decoration: underline;
|
||||
}
|
||||
} */
|
||||
|
||||
.masthead {
|
||||
background-color: #f8f9fa;
|
||||
|
||||
3
babel.config.js
Normal file
3
babel.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
|
||||
};
|
||||
1
docs/api/_category_.yml
Normal file
1
docs/api/_category_.yml
Normal file
@@ -0,0 +1 @@
|
||||
label: "API"
|
||||
243
docs/api/classes/Context.md
Normal file
243
docs/api/classes/Context.md
Normal file
@@ -0,0 +1,243 @@
|
||||
---
|
||||
id: "Context"
|
||||
title: "Class: Context"
|
||||
sidebar_label: "Context"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
Provides values shared between
|
||||
Message and ChatInputCommandInteraction
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• `Private` **new Context**(`oMsg?`, `oInterac?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `oMsg` | `Option`<`Message`<`boolean`\>\> | `None` |
|
||||
| `oInterac` | `Option`<`ChatInputCommandInteraction`<`CacheType`\>\> | `None` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:31](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L31)
|
||||
|
||||
## Accessors
|
||||
|
||||
### channel
|
||||
|
||||
• `get` **channel**(): [`Nullish`](../modules.md#nullish)<`TextBasedChannel`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
[`Nullish`](../modules.md#nullish)<`TextBasedChannel`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:63](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
### client
|
||||
|
||||
• `get` **client**(): `Client`<`boolean`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Client`<`boolean`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:108](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L108)
|
||||
|
||||
___
|
||||
|
||||
### createdTimestamp
|
||||
|
||||
• `get` **createdTimestamp**(): `number`
|
||||
|
||||
#### Returns
|
||||
|
||||
`number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:77](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### guild
|
||||
|
||||
• `get` **guild**(): `Guild`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Guild`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:84](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L84)
|
||||
|
||||
___
|
||||
|
||||
### guildId
|
||||
|
||||
• `get` **guildId**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:91](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L91)
|
||||
|
||||
___
|
||||
|
||||
### id
|
||||
|
||||
• `get` **id**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:56](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L56)
|
||||
|
||||
___
|
||||
|
||||
### inGuild
|
||||
|
||||
• `get` **inGuild**(): `boolean`
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:115](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L115)
|
||||
|
||||
___
|
||||
|
||||
### interaction
|
||||
|
||||
• `get` **interaction**(): `ChatInputCommandInteraction`<`CacheType`\>
|
||||
|
||||
Getting the ChatInputCommandInteraction object. Crashes if module type is
|
||||
CommandType.Text or the event fired in a Both command was
|
||||
Message
|
||||
|
||||
#### Returns
|
||||
|
||||
`ChatInputCommandInteraction`<`CacheType`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:52](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L52)
|
||||
|
||||
___
|
||||
|
||||
### member
|
||||
|
||||
• `get` **member**(): [`Nullish`](../modules.md#nullish)<`GuildMember` \| `APIGuildMember`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
[`Nullish`](../modules.md#nullish)<`GuildMember` \| `APIGuildMember`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:101](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L101)
|
||||
|
||||
___
|
||||
|
||||
### message
|
||||
|
||||
• `get` **message**(): `Message`<`boolean`\>
|
||||
|
||||
Getting the Message object. Crashes if module type is
|
||||
CommandType.Slash or the event fired in a Both command was
|
||||
ChatInputCommandInteraction
|
||||
|
||||
#### Returns
|
||||
|
||||
`Message`<`boolean`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:44](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### user
|
||||
|
||||
• `get` **user**(): `User`
|
||||
|
||||
#### Returns
|
||||
|
||||
`User`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:70](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L70)
|
||||
|
||||
## Methods
|
||||
|
||||
### isEmpty
|
||||
|
||||
▸ **isEmpty**(): `boolean`
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:129](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L129)
|
||||
|
||||
___
|
||||
|
||||
### reply
|
||||
|
||||
▸ **reply**(`content`): `Promise`<`Message`<`boolean`\>\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `content` | `string` \| `Omit`<`InteractionReplyOptions`, ``"fetchReply"``\> \| `ReplyMessageOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`Message`<`boolean`\>\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:133](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L133)
|
||||
|
||||
___
|
||||
|
||||
### wrap
|
||||
|
||||
▸ `Static` **wrap**(`wrappable`): [`Context`](Context.md)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `wrappable` | `Message`<`boolean`\> \| `ChatInputCommandInteraction`<`CacheType`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`Context`](Context.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/context.ts:122](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/context.ts#L122)
|
||||
1116
docs/api/classes/SernEmitter.md
Normal file
1116
docs/api/classes/SernEmitter.md
Normal file
File diff suppressed because it is too large
Load Diff
2
docs/api/classes/_category_.yml
Normal file
2
docs/api/classes/_category_.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
label: "Classes"
|
||||
position: 3
|
||||
116
docs/api/enums/CommandType.md
Normal file
116
docs/api/enums/CommandType.md
Normal file
@@ -0,0 +1,116 @@
|
||||
---
|
||||
id: "CommandType"
|
||||
title: "Enumeration: CommandType"
|
||||
sidebar_label: "CommandType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
export default commandModule({
|
||||
// highlight-next-line
|
||||
type : CommandType.Text,
|
||||
name : 'a text command'
|
||||
execute(message) {
|
||||
console.log(message.content)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### Both
|
||||
|
||||
• **Both** = ``3``
|
||||
|
||||
The CommandType for hybrid commands, text and slash
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:27](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### Button
|
||||
|
||||
• **Button** = ``16``
|
||||
|
||||
The CommandType for ButtonInteraction commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:39](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### MenuMsg
|
||||
|
||||
• **MenuMsg** = ``8``
|
||||
|
||||
The CommandType for MessageContextMenuInteraction commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:35](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L35)
|
||||
|
||||
___
|
||||
|
||||
### MenuSelect
|
||||
|
||||
• **MenuSelect** = ``32``
|
||||
|
||||
The CommandType for SelectMenuInteraction commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:43](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L43)
|
||||
|
||||
___
|
||||
|
||||
### MenuUser
|
||||
|
||||
• **MenuUser** = ``4``
|
||||
|
||||
The CommandType for UserContextMenuInteraction commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:31](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
### Modal
|
||||
|
||||
• **Modal** = ``64``
|
||||
|
||||
The CommandType for ModalSubmitInteraction commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:47](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L47)
|
||||
|
||||
___
|
||||
|
||||
### Slash
|
||||
|
||||
• **Slash** = ``2``
|
||||
|
||||
The CommandType for slash commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:23](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L23)
|
||||
|
||||
___
|
||||
|
||||
### Text
|
||||
|
||||
• **Text** = ``1``
|
||||
|
||||
The CommandType for text commands
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:19](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L19)
|
||||
57
docs/api/enums/EventType.md
Normal file
57
docs/api/enums/EventType.md
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
id: "EventType"
|
||||
title: "Enumeration: EventType"
|
||||
sidebar_label: "EventType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
export default eventModule({
|
||||
//highlight-next-line
|
||||
type : EventType.Discord,
|
||||
name : 'guildMemberAdd'
|
||||
execute(member : GuildMember) {
|
||||
console.log(member)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### Discord
|
||||
|
||||
• **Discord** = ``1``
|
||||
|
||||
The EventType for handling discord events
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:68](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
### External
|
||||
|
||||
• **External** = ``3``
|
||||
|
||||
The EventType for handling external events.
|
||||
Could be for example, `process` events, database events
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:77](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L77)
|
||||
|
||||
___
|
||||
|
||||
### Sern
|
||||
|
||||
• **Sern** = ``2``
|
||||
|
||||
The EventType for handling sern events
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:72](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L72)
|
||||
43
docs/api/enums/PayloadType.md
Normal file
43
docs/api/enums/PayloadType.md
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
id: "PayloadType"
|
||||
title: "Enumeration: PayloadType"
|
||||
sidebar_label: "PayloadType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### Failure
|
||||
|
||||
• **Failure** = ``"failure"``
|
||||
|
||||
The PayloadType for a SernEmitter failure event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:114](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L114)
|
||||
|
||||
___
|
||||
|
||||
### Success
|
||||
|
||||
• **Success** = ``"success"``
|
||||
|
||||
The PayloadType for a SernEmitter success event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:110](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L110)
|
||||
|
||||
___
|
||||
|
||||
### Warning
|
||||
|
||||
• **Warning** = ``"warning"``
|
||||
|
||||
The PayloadType for a SernEmitter warning event
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:118](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L118)
|
||||
43
docs/api/enums/PluginType.md
Normal file
43
docs/api/enums/PluginType.md
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
id: "PluginType"
|
||||
title: "Enumeration: PluginType"
|
||||
sidebar_label: "PluginType"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts
|
||||
export default function myPlugin() : EventPlugin<CommandType.Text> {
|
||||
//highlight-next-line
|
||||
type : PluginType.Event,
|
||||
execute([ctx, args], controller) {
|
||||
return controller.next();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
### Command
|
||||
|
||||
• **Command** = ``1``
|
||||
|
||||
The PluginType for CommandPlugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:97](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L97)
|
||||
|
||||
___
|
||||
|
||||
### Event
|
||||
|
||||
• **Event** = ``2``
|
||||
|
||||
The PluginType for EventPlugins
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/enums.ts:101](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/enums.ts#L101)
|
||||
2
docs/api/enums/_category_.yml
Normal file
2
docs/api/enums/_category_.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
label: "Enumerations"
|
||||
position: 2
|
||||
90
docs/api/index.md
Normal file
90
docs/api/index.md
Normal file
@@ -0,0 +1,90 @@
|
||||
---
|
||||
id: "index"
|
||||
title: "@sern/handler"
|
||||
sidebar_label: "Readme"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
# SernHandler
|
||||
|
||||
<a href="https://www.npmjs.com/package/@sern/handler"><img src="https://img.shields.io/npm/v/@sern/handler?maxAge=3600" alt="NPM version" /></a>
|
||||
<a href="https://www.npmjs.com/package/@sern/handler"><img src="https://img.shields.io/npm/dt/@sern/handler?maxAge=3600" alt="NPM downloads" /></a>
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
|
||||
A customizable, batteries-included, powerful discord.js framework to automate and streamline your bot development.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @sern/handler
|
||||
```
|
||||
|
||||
```sh
|
||||
yarn add @sern/handler
|
||||
```
|
||||
|
||||
```sh
|
||||
pnpm add @sern/handler
|
||||
```
|
||||
|
||||
## Basic Usage
|
||||
|
||||
#### ` index.js (CommonJS)`
|
||||
|
||||
```js
|
||||
const { Client, GatewayIntentBits } = require('discord.js');
|
||||
const { Sern } = require('@sern/handler');
|
||||
const { defaultPrefix, token } = require('./config.json');
|
||||
|
||||
const client = new Client({
|
||||
intents: [
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMembers,
|
||||
GatewayIntentBits.GuildMessages
|
||||
]
|
||||
});
|
||||
|
||||
Sern.init({
|
||||
client,
|
||||
defaultPrefix,
|
||||
commands : 'src/commands',
|
||||
});
|
||||
|
||||
client.login(token);
|
||||
```
|
||||
|
||||
#### ` ping.js (CommonJS)`
|
||||
|
||||
```js
|
||||
const { Sern, CommandType } = require('@sern/handler');
|
||||
|
||||
exports.default = {
|
||||
description: 'A ping pong command',
|
||||
type: CommandType.Slash,
|
||||
execute(ctx) {
|
||||
ctx.reply('pong!');
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
See our [templates](https://github.com/sern-handler/templates) for TypeScript examples and more
|
||||
|
||||
## CLI
|
||||
|
||||
It is **highly encouraged** to use the [command line interface](https://github.com/sern-handler/cli) for your project. Don't forget to view it.
|
||||
|
||||
## Links
|
||||
|
||||
- [Official Documentation](https://sern-handler.js.org)
|
||||
- [Support Server](https://discord.com/invite/mmyCTnYtbF)
|
||||
|
||||
## Contribute
|
||||
|
||||
- Read our contribution [guidelines](https://github.com/sern-handler/handler) carefully
|
||||
- Pull up on [issues](https://github.com/sern-handler/handler/issues) and report bugs
|
||||
- All kinds of contributions are welcomed.
|
||||
|
||||
## Roadmap
|
||||
|
||||
You can check our [roadmap](https://github.com/sern-handler/roadmap) to see what's going to be added or patched in the future.
|
||||
43
docs/api/interfaces/Controller.md
Normal file
43
docs/api/interfaces/Controller.md
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
id: "Controller"
|
||||
title: "Interface: Controller"
|
||||
sidebar_label: "Controller"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Properties
|
||||
|
||||
### next
|
||||
|
||||
• **next**: () => `Ok`<`void`\>
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (): `Ok`<`void`\>
|
||||
|
||||
##### Returns
|
||||
|
||||
`Ok`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:29](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### stop
|
||||
|
||||
• **stop**: () => `Err`<`void`\>
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (): `Err`<`void`\>
|
||||
|
||||
##### Returns
|
||||
|
||||
`Err`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:30](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L30)
|
||||
59
docs/api/interfaces/Wrapper.md
Normal file
59
docs/api/interfaces/Wrapper.md
Normal file
@@ -0,0 +1,59 @@
|
||||
---
|
||||
id: "Wrapper"
|
||||
title: "Interface: Wrapper"
|
||||
sidebar_label: "Wrapper"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
An object to be passed into Sern#init() function.
|
||||
|
||||
## Properties
|
||||
|
||||
### client
|
||||
|
||||
• `Readonly` **client**: `Client`<`boolean`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/wrapper.ts:10](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/wrapper.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### commands
|
||||
|
||||
• `Readonly` **commands**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/wrapper.ts:13](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/wrapper.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### defaultPrefix
|
||||
|
||||
• `Optional` `Readonly` **defaultPrefix**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/wrapper.ts:12](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/wrapper.ts#L12)
|
||||
|
||||
___
|
||||
|
||||
### events
|
||||
|
||||
• `Optional` `Readonly` **events**: `string` \| { `absPath`: `string` ; `mod`: `EventModule` }[] \| () => { `absPath`: `string` ; `mod`: `EventModule` }[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/wrapper.ts:14](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/wrapper.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
### sernEmitter
|
||||
|
||||
• `Optional` `Readonly` **sernEmitter**: [`SernEmitter`](../classes/SernEmitter.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/wrapper.ts:11](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/wrapper.ts#L11)
|
||||
2
docs/api/interfaces/_category_.yml
Normal file
2
docs/api/interfaces/_category_.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
label: "Interfaces"
|
||||
position: 4
|
||||
627
docs/api/modules.md
Normal file
627
docs/api/modules.md
Normal file
@@ -0,0 +1,627 @@
|
||||
---
|
||||
id: "modules"
|
||||
title: "@sern/handler"
|
||||
sidebar_label: "Exports"
|
||||
sidebar_position: 0.5
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## Namespaces
|
||||
|
||||
- [Sern](namespaces/Sern.md)
|
||||
|
||||
## Enumerations
|
||||
|
||||
- [CommandType](enums/CommandType.md)
|
||||
- [EventType](enums/EventType.md)
|
||||
- [PayloadType](enums/PayloadType.md)
|
||||
- [PluginType](enums/PluginType.md)
|
||||
|
||||
## Classes
|
||||
|
||||
- [Context](classes/Context.md)
|
||||
- [SernEmitter](classes/SernEmitter.md)
|
||||
|
||||
## Interfaces
|
||||
|
||||
- [Controller](interfaces/Controller.md)
|
||||
- [Wrapper](interfaces/Wrapper.md)
|
||||
|
||||
## Type Aliases
|
||||
|
||||
### Args
|
||||
|
||||
Ƭ **Args**: [`ParseType`](modules.md#parsetype)<{ `slash`: [`SlashOptions`](modules.md#slashoptions) ; `text`: `string`[] }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:11](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
### AutocompletePlugin
|
||||
|
||||
Ƭ **AutocompletePlugin**: [`Override`](modules.md#override)<`BaseModule`, { `execute`: (`autocmp`: `AutocompleteInteraction`, `controlller`: [`Controller`](interfaces/Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\> ; `type`: [`Event`](enums/PluginType.md#event) }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:92](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L92)
|
||||
|
||||
___
|
||||
|
||||
### BaseOptions
|
||||
|
||||
Ƭ **BaseOptions**: `ApplicationCommandChoicesData` \| `ApplicationCommandNonOptionsData` \| `ApplicationCommandChannelOptionData` \| `ApplicationCommandNumericOptionData` \| `ApplicationCommandAttachmentOption` \| [`SernAutocompleteData`](modules.md#sernautocompletedata)
|
||||
|
||||
Type that replaces autocomplete with [SernAutocompleteData](modules.md#sernautocompletedata)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/module.ts:181](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/module.ts#L181)
|
||||
|
||||
___
|
||||
|
||||
### BothCommand
|
||||
|
||||
Ƭ **BothCommand**: [`Override`](modules.md#override)<`BaseModule`, { `alias?`: `string`[] ; `execute`: (`ctx`: [`Context`](classes/Context.md), `args`: [`Args`](modules.md#args)) => `Awaitable`<`void` \| `unknown`\> ; `onEvent`: [`EventPlugin`](modules.md#eventplugin)<[`Both`](enums/CommandType.md#both)\>[] ; `options?`: [`SernOptionsData`](modules.md#sernoptionsdata)[] ; `plugins`: [`CommandPlugin`](modules.md#commandplugin)[] ; `type`: [`Both`](enums/CommandType.md#both) }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/module.ts:55](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/module.ts#L55)
|
||||
|
||||
___
|
||||
|
||||
### CommandModuleNoPlugins
|
||||
|
||||
Ƭ **CommandModuleNoPlugins**: { [T in CommandType]: Omit<CommandModuleDefs[T], "plugins" \| "onEvent"\> }
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:145](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L145)
|
||||
|
||||
___
|
||||
|
||||
### CommandModulePlugin
|
||||
|
||||
Ƭ **CommandModulePlugin**<`T`\>: [`EventPlugin`](modules.md#eventplugin)<`T`\> \| [`CommandPlugin`](modules.md#commandplugin)<`T`\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends [`CommandType`](enums/CommandType.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:173](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L173)
|
||||
|
||||
___
|
||||
|
||||
### CommandPlugin
|
||||
|
||||
Ƭ **CommandPlugin**<`T`\>: { [K in T]: Override<BasePlugin, Object\> }[`T`]
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends keyof `CommandModuleDefs` = keyof `CommandModuleDefs` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:40](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L40)
|
||||
|
||||
___
|
||||
|
||||
### DefinedCommandModule
|
||||
|
||||
Ƭ **DefinedCommandModule**: [`DefinitelyDefined`](modules.md#definitelydefined)<`CommandModule`, ``"name"`` \| ``"description"``\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:48](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L48)
|
||||
|
||||
___
|
||||
|
||||
### DefinedEventModule
|
||||
|
||||
Ƭ **DefinedEventModule**: [`DefinitelyDefined`](modules.md#definitelydefined)<`EventModule`, ``"name"`` \| ``"description"``\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:49](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### DefinedModule
|
||||
|
||||
Ƭ **DefinedModule**: [`DefinitelyDefined`](modules.md#definitelydefined)<[`Module`](modules.md#module), ``"name"`` \| ``"description"``\>
|
||||
|
||||
After modules are transformed, name and description are given default values if none
|
||||
are provided to Module. This type represents that transformation
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:47](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L47)
|
||||
|
||||
___
|
||||
|
||||
### DefinitelyDefined
|
||||
|
||||
Ƭ **DefinitelyDefined**<`T`, `K`\>: { [L in K]-?: T[L] extends Record<string, unknown\> ? DefinitelyDefined<T[L], keyof T[L]\> : Required<T\>[L] } & `T`
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | `T` |
|
||||
| `K` | extends keyof `T` = keyof `T` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:18](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
### DiscordEmitterPlugin
|
||||
|
||||
Ƭ **DiscordEmitterPlugin**: [`Override`](modules.md#override)<`BasePlugin`, { `execute`: (`wrapper`: `Client`, `module`: [`DefinitelyDefined`](modules.md#definitelydefined)<`DiscordEventCommand`, ``"name"`` \| ``"description"``\>, `controller`: [`Controller`](interfaces/Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\> ; `type`: [`Command`](enums/PluginType.md#command) }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:57](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L57)
|
||||
|
||||
___
|
||||
|
||||
### DiscordEventPlugin
|
||||
|
||||
Ƭ **DiscordEventPlugin**<`T`\>: [`Override`](modules.md#override)<`BasePlugin`, { `execute`: (`args`: `ClientEvents`[`T`], `controller`: [`Controller`](interfaces/Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\> ; `name?`: `T` ; `type`: [`Event`](enums/PluginType.md#event) }\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends keyof `ClientEvents` = keyof `ClientEvents` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:136](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L136)
|
||||
|
||||
___
|
||||
|
||||
### EventInput
|
||||
|
||||
Ƭ **EventInput**: `string` \| { `absPath`: `string` ; `mod`: `EventModule` }[] \| () => { `absPath`: `string` ; `mod`: `EventModule` }[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:24](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L24)
|
||||
|
||||
___
|
||||
|
||||
### EventModuleCommandPluginDefs
|
||||
|
||||
Ƭ **EventModuleCommandPluginDefs**: `Object`
|
||||
|
||||
Event Module Command Plugins
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `1` | [`DiscordEmitterPlugin`](modules.md#discordemitterplugin) |
|
||||
| `2` | [`SernEmitterPlugin`](modules.md#sernemitterplugin) |
|
||||
| `3` | [`ExternalEmitterPlugin`](modules.md#externalemitterplugin) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:163](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L163)
|
||||
|
||||
___
|
||||
|
||||
### EventModuleEventPluginDefs
|
||||
|
||||
Ƭ **EventModuleEventPluginDefs**: `Object`
|
||||
|
||||
Event Module Event Plugins
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `1` | [`DiscordEventPlugin`](modules.md#discordeventplugin) |
|
||||
| `2` | [`SernEventPlugin`](modules.md#serneventplugin) |
|
||||
| `3` | [`ExternalEventPlugin`](modules.md#externaleventplugin) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:154](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L154)
|
||||
|
||||
___
|
||||
|
||||
### EventModulePlugin
|
||||
|
||||
Ƭ **EventModulePlugin**<`T`\>: [`EventModuleEventPluginDefs`](modules.md#eventmoduleeventplugindefs)[`T`] \| [`EventModuleCommandPluginDefs`](modules.md#eventmodulecommandplugindefs)[`T`]
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends [`EventType`](enums/EventType.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:169](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L169)
|
||||
|
||||
___
|
||||
|
||||
### EventModulesNoPlugins
|
||||
|
||||
Ƭ **EventModulesNoPlugins**: { [T in EventType]: Omit<EventModuleDefs[T], "plugins" \| "onEvent"\> }
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:148](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L148)
|
||||
|
||||
___
|
||||
|
||||
### EventPlugin
|
||||
|
||||
Ƭ **EventPlugin**<`T`\>: { [K in T]: Override<BasePlugin, Object\> }[`T`]
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends keyof `CommandModuleDefs` = keyof `CommandModuleDefs` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:103](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L103)
|
||||
|
||||
___
|
||||
|
||||
### ExternalEmitterPlugin
|
||||
|
||||
Ƭ **ExternalEmitterPlugin**<`T`\>: [`Override`](modules.md#override)<`BasePlugin`, { `execute`: (`wrapper`: `T`, `module`: [`DefinitelyDefined`](modules.md#definitelydefined)<`ExternalEventCommand`, ``"name"`` \| ``"description"``\>, `controller`: [`Controller`](interfaces/Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\> ; `type`: [`Command`](enums/PluginType.md#command) }\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends `EventEmitter` = `EventEmitter` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:68](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
### ExternalEventPlugin
|
||||
|
||||
Ƭ **ExternalEventPlugin**: [`Override`](modules.md#override)<`BasePlugin`, { `execute`: (`args`: `unknown`[], `controller`: [`Controller`](interfaces/Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\> ; `type`: [`Event`](enums/PluginType.md#event) }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:128](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L128)
|
||||
|
||||
___
|
||||
|
||||
### InputCommandModule
|
||||
|
||||
Ƭ **InputCommandModule**: { [T in CommandType]: CommandModuleNoPlugins[T] & Object }[[`CommandType`](enums/CommandType.md)]
|
||||
|
||||
User inputs this type. Sern processes behind the scenes for better usage
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:178](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L178)
|
||||
|
||||
___
|
||||
|
||||
### InputEventModule
|
||||
|
||||
Ƭ **InputEventModule**: { [T in EventType]: EventModulesNoPlugins[T] & Object }[[`EventType`](enums/EventType.md)]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:182](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L182)
|
||||
|
||||
___
|
||||
|
||||
### IsOptional
|
||||
|
||||
Ƭ **IsOptional**<`T`\>: { [K in keyof T]-?: T[K] extends Required<T\>[K] ? false : true }
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:31](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L31)
|
||||
|
||||
___
|
||||
|
||||
### Module
|
||||
|
||||
Ƭ **Module**: `CommandModule` \| `EventModule`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/module.ts:141](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/module.ts#L141)
|
||||
|
||||
___
|
||||
|
||||
### Nullish
|
||||
|
||||
Ƭ **Nullish**<`T`\>: `T` \| `undefined` \| ``null``
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:4](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L4)
|
||||
|
||||
___
|
||||
|
||||
### Override
|
||||
|
||||
Ƭ **Override**<`T1`, `T2`\>: `Omit`<`T1`, keyof `T2`\> & `T2`
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T1` |
|
||||
| `T2` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:16](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### ParseType
|
||||
|
||||
Ƭ **ParseType**<`T`\>: { [K in keyof T]: T[K] extends unknown ? [k: K, args: T[K]] : never }[keyof `T`]
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:7](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### Payload
|
||||
|
||||
Ƭ **Payload**: { `module`: [`Module`](modules.md#module) ; `type`: [`Success`](enums/PayloadType.md#success) } \| { `module`: [`Module`](modules.md#module) \| `undefined` ; `reason`: `string` \| `Error` ; `type`: [`Failure`](enums/PayloadType.md#failure) }
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:50](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L50)
|
||||
|
||||
___
|
||||
|
||||
### Reconstruct
|
||||
|
||||
Ƭ **Reconstruct**<`T`\>: `T` extends `Omit`<infer O, `never`\> ? `O` & [`Reconstruct`](modules.md#reconstruct)<`O`\> : `T`
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name |
|
||||
| :------ |
|
||||
| `T` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:29](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### SernAutocompleteData
|
||||
|
||||
Ƭ **SernAutocompleteData**: [`Override`](modules.md#override)<`BaseApplicationCommandOptionsData`, { `autocomplete`: ``true`` ; `command`: `AutocompleteCommand` ; `type`: `ApplicationCommandOptionType.String` \| `ApplicationCommandOptionType.Number` \| `ApplicationCommandOptionType.Integer` }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/module.ts:166](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/module.ts#L166)
|
||||
|
||||
___
|
||||
|
||||
### SernEmitterPlugin
|
||||
|
||||
Ƭ **SernEmitterPlugin**: [`Override`](modules.md#override)<`BasePlugin`, { `execute`: (`wrapper`: [`SernEmitter`](classes/SernEmitter.md), `module`: [`DefinitelyDefined`](modules.md#definitelydefined)<`SernEventCommand`, ``"name"`` \| ``"description"``\>, `controller`: [`Controller`](interfaces/Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\> ; `type`: [`Command`](enums/PluginType.md#command) }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:80](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L80)
|
||||
|
||||
___
|
||||
|
||||
### SernEventPlugin
|
||||
|
||||
Ƭ **SernEventPlugin**<`T`\>: [`Override`](modules.md#override)<`BasePlugin`, { `execute`: (`args`: [`SernEventsMapping`](modules.md#serneventsmapping)[`T`], `controller`: [`Controller`](interfaces/Controller.md)) => `Awaitable`<`Result`<`void`, `void`\>\> ; `name?`: `T` ; `type`: [`Event`](enums/PluginType.md#event) }\>
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends keyof [`SernEventsMapping`](modules.md#serneventsmapping) = keyof [`SernEventsMapping`](modules.md#serneventsmapping) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/plugins/plugin.ts:116](https://github.com/sern-handler/handler/blob/2009593/src/handler/plugins/plugin.ts#L116)
|
||||
|
||||
___
|
||||
|
||||
### SernEventsMapping
|
||||
|
||||
Ƭ **SernEventsMapping**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `error` | [`Error` \| `string`] |
|
||||
| `module.activate` | [[`Payload`](modules.md#payload)] |
|
||||
| `module.register` | [[`Payload`](modules.md#payload)] |
|
||||
| `warning` | [`string`] |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:53](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L53)
|
||||
|
||||
___
|
||||
|
||||
### SernOptionsData
|
||||
|
||||
Ƭ **SernOptionsData**<`U`\>: `U` extends `ApplicationCommandSubCommandData` ? [`SernSubCommandData`](modules.md#sernsubcommanddata) : `U` extends `ApplicationCommandSubGroupData` ? [`SernSubCommandGroupData`](modules.md#sernsubcommandgroupdata) : [`BaseOptions`](modules.md#baseoptions)
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `U` | extends `ApplicationCommandOptionData` = `ApplicationCommandOptionData` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/module.ts:205](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/module.ts#L205)
|
||||
|
||||
___
|
||||
|
||||
### SernSubCommandData
|
||||
|
||||
Ƭ **SernSubCommandData**: [`Override`](modules.md#override)<`Omit`<`BaseApplicationCommandOptionsData`, ``"required"``\>, { `options?`: [`BaseOptions`](modules.md#baseoptions)[] ; `type`: `ApplicationCommandOptionType.Subcommand` }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/module.ts:189](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/module.ts#L189)
|
||||
|
||||
___
|
||||
|
||||
### SernSubCommandGroupData
|
||||
|
||||
Ƭ **SernSubCommandGroupData**: [`Override`](modules.md#override)<`Omit`<`BaseApplicationCommandOptionsData`, ``"required"``\>, { `options?`: [`SernSubCommandData`](modules.md#sernsubcommanddata)[] ; `type`: `ApplicationCommandOptionType.SubcommandGroup` }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/module.ts:197](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/module.ts#L197)
|
||||
|
||||
___
|
||||
|
||||
### SlashCommand
|
||||
|
||||
Ƭ **SlashCommand**: [`Override`](modules.md#override)<`BaseModule`, { `execute`: (`ctx`: [`Context`](classes/Context.md), `args`: [``"slash"``, [`SlashOptions`](modules.md#slashoptions)]) => `Awaitable`<`void` \| `unknown`\> ; `onEvent`: [`EventPlugin`](modules.md#eventplugin)<[`Slash`](enums/CommandType.md#slash)\>[] ; `options?`: [`SernOptionsData`](modules.md#sernoptionsdata)[] ; `plugins`: [`CommandPlugin`](modules.md#commandplugin)[] ; `type`: [`Slash`](enums/CommandType.md#slash) }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/module.ts:44](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/module.ts#L44)
|
||||
|
||||
___
|
||||
|
||||
### SlashOptions
|
||||
|
||||
Ƭ **SlashOptions**: `Omit`<`CommandInteractionOptionResolver`, ``"getMessage"`` \| ``"getFocused"``\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:13](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L13)
|
||||
|
||||
___
|
||||
|
||||
### SpreadParams
|
||||
|
||||
Ƭ **SpreadParams**<`T`\>: (`args`: `Parameters`<`T`\>[`number`]) => `unknown`
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends (...`args`: `never`) => `unknown` |
|
||||
|
||||
#### Type declaration
|
||||
|
||||
▸ (`args`): `unknown`
|
||||
|
||||
Turns a function with a union of array of args into a single union
|
||||
[ T , V , B ] | [ A ] => T | V | B | A
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `args` | `Parameters`<`T`\>[`number`] |
|
||||
|
||||
##### Returns
|
||||
|
||||
`unknown`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/types/handler.ts:39](https://github.com/sern-handler/handler/blob/2009593/src/types/handler.ts#L39)
|
||||
|
||||
___
|
||||
|
||||
### TextCommand
|
||||
|
||||
Ƭ **TextCommand**: [`Override`](modules.md#override)<`BaseModule`, { `alias?`: `string`[] ; `execute`: (`ctx`: [`Context`](classes/Context.md), `args`: [``"text"``, `string`[]]) => `Awaitable`<`void` \| `unknown`\> ; `onEvent`: [`EventPlugin`](modules.md#eventplugin)<[`Text`](enums/CommandType.md#text)\>[] ; `plugins`: [`CommandPlugin`](modules.md#commandplugin)[] ; `type`: [`Text`](enums/CommandType.md#text) }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/structures/module.ts:33](https://github.com/sern-handler/handler/blob/2009593/src/handler/structures/module.ts#L33)
|
||||
|
||||
## Functions
|
||||
|
||||
### commandModule
|
||||
|
||||
▸ **commandModule**(`mod`): `CommandModule`
|
||||
|
||||
The wrapper function to define command modules for sern
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `mod` | [`InputCommandModule`](modules.md#inputcommandmodule) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`CommandModule`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:86](https://github.com/sern-handler/handler/blob/2009593/src/handler/sern.ts#L86)
|
||||
|
||||
___
|
||||
|
||||
### eventModule
|
||||
|
||||
▸ **eventModule**(`mod`): `EventModule`
|
||||
|
||||
The wrapper function to define event modules for sern
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `mod` | [`InputEventModule`](modules.md#inputeventmodule) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`EventModule`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:107](https://github.com/sern-handler/handler/blob/2009593/src/handler/sern.ts#L107)
|
||||
114
docs/api/namespaces/Sern.md
Normal file
114
docs/api/namespaces/Sern.md
Normal file
@@ -0,0 +1,114 @@
|
||||
---
|
||||
id: "Sern"
|
||||
title: "Namespace: Sern"
|
||||
sidebar_label: "Sern"
|
||||
sidebar_position: 0
|
||||
custom_edit_url: null
|
||||
---
|
||||
|
||||
## References
|
||||
|
||||
### commandModule
|
||||
|
||||
Re-exports [commandModule](../modules.md#commandmodule)
|
||||
|
||||
___
|
||||
|
||||
### eventModule
|
||||
|
||||
Re-exports [eventModule](../modules.md#eventmodule)
|
||||
|
||||
## Variables
|
||||
|
||||
### controller
|
||||
|
||||
• `Const` **controller**: `Object`
|
||||
|
||||
The object passed into every plugin to control a command's behavior
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `next` | () => `OkImpl`<`void`\> |
|
||||
| `stop` | () => `ErrImpl`<`void`\> |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:77](https://github.com/sern-handler/handler/blob/2009593/src/handler/sern.ts#L77)
|
||||
|
||||
## Functions
|
||||
|
||||
### addExternal
|
||||
|
||||
▸ **addExternal**<`T`\>(`emitter`): `void`
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts title="src/index.ts"
|
||||
//Add this before initiating Sern!
|
||||
Sern.addExternal(new Level())
|
||||
```
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts title="events/level.ts"
|
||||
export default eventModule({
|
||||
emitter: 'Level',
|
||||
type : EventType.External,
|
||||
name: 'error',
|
||||
execute(args) {
|
||||
console.log(args)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
#### Type parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `T` | extends `__module` |
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `emitter` | `T` | Any external event emitter. The object will be stored in a map, and then fetched by the name of the instance's class. As there are infinite possibilities to adding external event emitters, Most types aren't provided and are as narrow as possibly can. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:67](https://github.com/sern-handler/handler/blob/2009593/src/handler/sern.ts#L67)
|
||||
|
||||
___
|
||||
|
||||
### init
|
||||
|
||||
▸ **init**(`wrapper`): `void`
|
||||
|
||||
**`Example`**
|
||||
|
||||
```ts title="src/index.ts"
|
||||
Sern.init({
|
||||
client,
|
||||
defaultPrefix: '!',
|
||||
commands: 'dist/commands',
|
||||
})
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `wrapper` | [`Wrapper`](../interfaces/Wrapper.md) | Options to pass into sern. Function to start the handler up |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/handler/sern.ts:34](https://github.com/sern-handler/handler/blob/2009593/src/handler/sern.ts#L34)
|
||||
2
docs/api/namespaces/_category_.yml
Normal file
2
docs/api/namespaces/_category_.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
label: "Namespaces"
|
||||
position: 1
|
||||
25
docs/guide/README.md
Normal file
25
docs/guide/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Introduction
|
||||
|
||||
Welcome to our official guide. This guide will go through all the core features of the framework.
|
||||
- 💖 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.
|
||||
|
||||
- discord.js v14 is the only supported library at the moment
|
||||
|
||||
## You will learn
|
||||
* [sern's goal](walkthrough/goal.md)
|
||||
* How to use sern with the [CLI](walkthrough/cli.md)
|
||||
* [Your first command](walkthrough/first-command.md)
|
||||
* [The Context class](walkthrough/first-command.md#context-class)
|
||||
|
||||
### Working with plugins
|
||||
* [Plugins](walkthrough/plugins.md)
|
||||
- [Command Plugins](walkthrough/plugins.md#command-plugins)
|
||||
- [Event Plugins](walkthrough/plugins.md#event-plugins)
|
||||
### Events
|
||||
* [The SernEmitter class](walkthrough/sern-emitter.md)
|
||||
* [Your first event](walkthrough/first-event.md)
|
||||
|
||||
### Good to know
|
||||
* [sern.config.json](walkthrough/good-to-know.md)
|
||||
6
docs/guide/getting-started/preparing.md
Normal file
6
docs/guide/getting-started/preparing.md
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
# Preparing to Code
|
||||
|
||||
After installing and IDE you need to install node.
|
||||
|
||||
You can download the LTS version of node right [here](https://nodejs.org/en/download/release/latest/)
|
||||
34
docs/guide/walkthrough/cli.md
Normal file
34
docs/guide/walkthrough/cli.md
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# CLI
|
||||
|
||||
Setting up the [CLI](https://github.com/sern-handler/cli) is easy. <br />
|
||||
- To start a brand-new project, run :
|
||||
```sh
|
||||
sern init (-y)
|
||||
```
|
||||
|
||||
:::tip
|
||||
It creates a directory for you so you don't need to!
|
||||
:::
|
||||
|
||||
Include the `-y` flag if you want to set up defaults. The default langauge is [Typescript](https://www.typescriptlang.org/) <br />
|
||||
|
||||
- To install [plugins](plugins.md) maintained by the community [repository](https://github.com/sern-handler/awesome-plugins),
|
||||
```
|
||||
sern plugins
|
||||
```
|
||||
:::info
|
||||
Make sure to have a correct [sern.config.json](./good-to-know.md#sernconfigjson)
|
||||
:::
|
||||
This will display a menu selection of all installable plugins. <br />
|
||||
**Note**: You must have a [sern.config.json](good-to-know.md) to use this command.
|
||||
If you want to view plugins, visit the repository linked above.
|
||||
|
||||
- To install extra utilities into your project
|
||||
```
|
||||
sern extra
|
||||
```
|
||||
|
||||
8
docs/guide/walkthrough/conclusion.md
Normal file
8
docs/guide/walkthrough/conclusion.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
sidebar_position: 8
|
||||
---
|
||||
|
||||
# Conclusion
|
||||
If you reached this far, thank you for reading! We hope you have learned the necessities you need
|
||||
to create a bot with the sern framework. If you have any other questions, bugs, feature requests, concerns, please join our
|
||||
[community server](https://discord.gg/QgnfxWzrcj), and we'll be glad to answer your questions.
|
||||
115
docs/guide/walkthrough/first-command.md
Normal file
115
docs/guide/walkthrough/first-command.md
Normal file
@@ -0,0 +1,115 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
# First Command
|
||||
We will dissect a basic command.
|
||||
If you installed a new project via the cli, This is the `ping` command located in src/commands folder.
|
||||
|
||||
Typescript
|
||||
```typescript
|
||||
import { commandModule, CommandType } from '@sern/handler';
|
||||
|
||||
export default commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [],
|
||||
description: 'A ping command',
|
||||
//alias : [],
|
||||
execute: async (ctx, args) => {
|
||||
await ctx.reply({ content: 'Pong 🏓' });
|
||||
},
|
||||
});
|
||||
```
|
||||
Javascript
|
||||
```javascript
|
||||
const { CommandType, commandModule } = require('@sern/handler');
|
||||
|
||||
exports.default = commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [],
|
||||
description: 'A ping command',
|
||||
//alias : [],
|
||||
execute: async (ctx, args) => {
|
||||
await ctx.reply('Pong 🏓');
|
||||
},
|
||||
})
|
||||
```
|
||||
To view what each of these properties mean in depth, visit the [official documentation](https://sern-handler.js.org/docs/api/enums/CommandType).
|
||||
### 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 the command types can be found in the [official documentation](https://sern-handler.js.org/docs/api/enums/CommandType)!
|
||||
<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:
|
||||
```typescript
|
||||
import { commandModule, CommandType } from '@sern/handler';
|
||||
export default commandModule({
|
||||
name: 'dm-me',
|
||||
type: CommandType.Modal,
|
||||
async execute (modal) {
|
||||
const value = modal.fields.getTextInputValue('message');
|
||||
modal.client.users.fetch('182326315813306368').then( u =>
|
||||
u.send(value + ` from ${modal.user}`)
|
||||
);
|
||||
modal.reply( { ephemeral:true, content: 'Sent' })
|
||||
}
|
||||
});
|
||||
```
|
||||
Javascript:
|
||||
```javascript
|
||||
const { CommandType, commandModule } = require('@sern/handler');
|
||||
exports.default = commandModule({
|
||||
name: 'dm-me',
|
||||
type: CommandType.Modal,
|
||||
async execute (modal) {
|
||||
const value = modal.fields.getTextInputValue('message');
|
||||
modal.client.users.fetch('182326315813306368').then( u =>
|
||||
u.send(value + ` from ${modal.user}`)
|
||||
);
|
||||
modal.reply( { ephemeral:true, content: 'Sent' })
|
||||
}
|
||||
});
|
||||
```
|
||||
Commands are straight forward. Keep in mind, every other property on the commandModule object is
|
||||
optional **except** the type and execute function.
|
||||
|
||||
# Context class
|
||||
The provided Context class helps with modules of `CommandType.Both` (A mixture of slash / legacy commands).
|
||||
|
||||
The Context class is passed into modules with type :
|
||||
- `CommandType.Both`
|
||||
- `CommandType.Slash`
|
||||
- `CommandType.Text`
|
||||
|
||||
This data structure helps interop between legacy commands and slash commands with ease.
|
||||
:::note
|
||||
View the [docs](../../api/classes/Context.md)
|
||||
:::
|
||||
|
||||
Typescript:
|
||||
```typescript
|
||||
export default commandModule({
|
||||
name: 'ping',
|
||||
type: CommandType.Both,
|
||||
async execute(ctx: Context) {
|
||||
await ctx.reply(`pong ${ctx.user}`)
|
||||
// .reply is shared between both message and interaction!
|
||||
// So is an User object!
|
||||
}
|
||||
});
|
||||
```
|
||||
Javascript:
|
||||
```javascript
|
||||
exports.default = commandModule({
|
||||
name: 'ping',
|
||||
type: CommandType.Both,
|
||||
async execute(ctx) { //ctx is a Context instance
|
||||
await ctx.reply(`pong ${ctx.user}`)
|
||||
// .reply is shared between both message and interaction!
|
||||
// So is an User object!
|
||||
}
|
||||
});
|
||||
```
|
||||
63
docs/guide/walkthrough/first-event.md
Normal file
63
docs/guide/walkthrough/first-event.md
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# First Event Module
|
||||
We will dissect a basic event module. <br />
|
||||
Typescript:
|
||||
```typescript
|
||||
export default eventModule({
|
||||
type: EventType.Sern,
|
||||
plugins : [], //NOT SUPPORTED YET!!
|
||||
name: 'module.activate', //name of event.
|
||||
execute(event) {
|
||||
console.log(event);
|
||||
}
|
||||
})
|
||||
```
|
||||
Javascript:
|
||||
```javascript
|
||||
exports.default = eventModule({
|
||||
type: EventType.Sern,
|
||||
plugins : [], //NOT SUPPORTED YET!!
|
||||
name: 'module.activate',
|
||||
execute(event) {
|
||||
console.log(event);
|
||||
}
|
||||
})
|
||||
```
|
||||
Like command modules, the `type` property denotes what kind of event it is, which
|
||||
can be found [here](https://sern-handler.js.org/docs/api/enums/EventType).
|
||||
|
||||
To view what each of these properties mean in depth, visit the [official documentation](https://sern-handler.js.org/docs/api/enums/EventType).
|
||||
|
||||
<br />
|
||||
Event modules are laid out similarly to command modules. These listen to any and all event you provide.
|
||||
In the current version 1.1.0-beta, plugins are not supported.
|
||||
|
||||
### Another example of an event module
|
||||
|
||||
Typescript:
|
||||
```typescript
|
||||
export default eventModule({
|
||||
type: EventType.Discord,
|
||||
plugins : [], //NOT SUPPORTED YET!!
|
||||
name: 'guildMemberAdd', //name of event.
|
||||
async execute(member) {
|
||||
await member.client.channels.fetch('channel-id').send(`Welcome, ${member}`);
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Javascript:
|
||||
```typescript
|
||||
|
||||
exports.default = eventModule({
|
||||
type: EventType.Discord,
|
||||
plugins : [], //NOT SUPPORTED YET!!
|
||||
name: 'guildMemberAdd', //name of event.
|
||||
async execute(member) {
|
||||
await member.client.channels.fetch('channel-id').send(`Welcome, ${member}`);
|
||||
}
|
||||
})
|
||||
```
|
||||
9
docs/guide/walkthrough/goal.md
Normal file
9
docs/guide/walkthrough/goal.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Goal
|
||||
|
||||
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.
|
||||
24
docs/guide/walkthrough/good-to-know.md
Normal file
24
docs/guide/walkthrough/good-to-know.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
sidebar_position: 7
|
||||
---
|
||||
|
||||
# Good to know
|
||||
|
||||
## sern.config.json
|
||||
<p>A sern.config.json, although not necessary, allows your project to communicate with our cli.</p>
|
||||
|
||||
For example, when installing typescript plugins, the language property is necessary to install from our
|
||||
[open source repository](https://github.com/sern-handler/awesome-plugins). <br />
|
||||
|
||||
Using the cli and running `sern init --sync` on pre-existing projects should install this json file in the root directory given.
|
||||
Or, if this is a brand-new project, `sern init` automatically installs it.
|
||||
|
||||
```json
|
||||
{
|
||||
"language": "typescript",
|
||||
"paths": {
|
||||
"base": "src",
|
||||
"commands": "commands"
|
||||
}
|
||||
}
|
||||
```
|
||||
157
docs/guide/walkthrough/plugins.md
Normal file
157
docs/guide/walkthrough/plugins.md
Normal file
@@ -0,0 +1,157 @@
|
||||
---
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# Plugins
|
||||
|
||||
<p>As of now, modules seem a little underwhelming. It appears that sern doesn't have all the features of a standard handler,
|
||||
which manages permissions, categorizes, cool-downs, publishes application commands, role permissions, etc.</p>
|
||||
|
||||
|
||||
<p>Many important parts that manage access and help streamline command creation to make are apparently absent.
|
||||
Below is an example of an event plugin, one of the types of plugins.</p>
|
||||
|
||||
Typescript:
|
||||
```typescript
|
||||
export function serenOnly(): EventPlugin<CommandType.Both> {
|
||||
return {
|
||||
type: PluginType.Event,
|
||||
async execute([ctx, args], controller) {
|
||||
if (ctx.user.id !== "182326315813306368") {
|
||||
await ctx.reply({content: "You cannot use this command"})
|
||||
return controller.stop()
|
||||
}
|
||||
return controller.next();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Javascript:
|
||||
```javascript
|
||||
export function serenOnly() {
|
||||
return {
|
||||
type: PluginType.Event,
|
||||
async execute([ctx, args], controller) {
|
||||
if (ctx.user.id !== "182326315813306368") {
|
||||
await ctx.reply({content: "You cannot use this command"})
|
||||
return controller.stop()
|
||||
}
|
||||
return controller.next();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br /> As part of our extensibility, the plugins feature make sern just as powerful, if not more powerful than
|
||||
standard handlers.
|
||||
Plugins modify and add new behavior to standard modules, extending customizability and implementing automation.
|
||||
|
||||
<br /> At the moment, there are two types of plugins:
|
||||
|
||||
- Command Plugins
|
||||
- Event Plugins
|
||||
|
||||
## Command Plugins
|
||||
All modules are registered into sern's system. With command plugins, you can modify how commands are loaded,
|
||||
or do some kind of preprocessing before they are loaded into sern.
|
||||
### The controller object
|
||||
```typescript
|
||||
export interface Controller {
|
||||
next: () => Ok<void>;
|
||||
stop: () => Err<void>;
|
||||
}
|
||||
```
|
||||
An instance of the above object is passed into every plugin. <br />
|
||||
This controls whether a module is stored into sern. <br />
|
||||
Typescript:
|
||||
```typescript
|
||||
export function inDir(dir : string) : CommandPlugin<CommandType.Both> {
|
||||
return {
|
||||
type: PluginType.Command,
|
||||
async execute(wrapper, { absPath, module }, controller) {
|
||||
if(path.dirname(absPath) !== dir) {
|
||||
console.log(+new Date(), `${module.name} is not in the correct directory!`);
|
||||
return controller.stop()
|
||||
}
|
||||
console.log(+new Date(), `${module.name} is in the correct directory!`);
|
||||
return controller.next(); //continue
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Javascript:
|
||||
```javascript
|
||||
export function inDir(dir : string) {
|
||||
return {
|
||||
type: PluginType.Command,
|
||||
async execute(wrapper, { absPath, module }, controller) {
|
||||
if(path.dirname(absPath) !== dir) {
|
||||
console.log(+new Date(), `${module.name} is not in the correct directory!`);
|
||||
return controller.stop()
|
||||
}
|
||||
console.log(+new Date(), `${module.name} is in the correct directory!`);
|
||||
return controller.next(); //continue
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Above, this simple plugin logs that the module has been loaded along with a timestamp. <br />
|
||||
Again, it is up to **you** to define plugin logic! The possibilities to customize your bots are endless.
|
||||
:::tip
|
||||
Command Plugins are good for ensuring the shape, location, and preprocessing of your commands.
|
||||
:::
|
||||
## Event Plugins
|
||||
 <br />
|
||||
- An event is emitted by discord.js.
|
||||
- This event is passed to all plugins (**in order!!**),
|
||||
- If all are successful,
|
||||
|
||||
The command is executed. Calling `controller.stop()` notifies sern that this command should not be run,
|
||||
and this event is ignored.
|
||||
|
||||
<p>So, what does a command module look like with plugins?</p>
|
||||
|
||||
Typescript:
|
||||
```typescript
|
||||
import { commandModule, CommandType } from '@sern/handler';
|
||||
|
||||
export default commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [
|
||||
inDir("other"),
|
||||
serenOnly()
|
||||
],
|
||||
description: 'A ping command',
|
||||
//alias : [],
|
||||
execute: async (ctx, args) => {
|
||||
await ctx.reply({ content: 'Pong 🏓' });
|
||||
},
|
||||
});
|
||||
```
|
||||
Javascript:
|
||||
```typescript
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
|
||||
exports.default = commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [
|
||||
inDir("other"),
|
||||
serenOnly() //The plugins in this section applied to this module!
|
||||
],
|
||||
description: 'A ping command',
|
||||
//alias : [],
|
||||
execute: async (ctx, args) => {
|
||||
await ctx.reply({ content: 'Pong 🏓' });
|
||||
},
|
||||
});
|
||||
```
|
||||
Can you predict the behavior of this command?
|
||||
|
||||
- Before loading into sern, this command module will check if this module is in the correct directory `other`.
|
||||
- Before an event occurs, this command module will check if the user has the id `182326315813306368`.
|
||||
|
||||
:::tip
|
||||
Event Plugins are good for filtering, preconditions, parsing.
|
||||
:::
|
||||
|
||||
If all plugins return `controller.next()`, this command replies `Pong 🏓`
|
||||
13
docs/guide/walkthrough/sern-emitter.md
Normal file
13
docs/guide/walkthrough/sern-emitter.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
sidebar_position: 6
|
||||
---
|
||||
|
||||
# The SernEmitter class
|
||||
You're shipped with the SernEmitter. This EventEmitter listens to
|
||||
- command modules executing and its status, the `module.activate` event
|
||||
- command modules registered and its status, the `module.register` event
|
||||
- any error that occurs, the `error` event
|
||||
- `warn` events, where it is possible to throw errors
|
||||
|
||||
You can put these and other event listeners into [event modules](./first-event.md)!
|
||||
<br/>View all <a href="https://sern-handler.js.org/docs/api/modules#serneventsmapping">events</a>
|
||||
13
docs/intro.md
Normal file
13
docs/intro.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
sidebar_position: 0
|
||||
---
|
||||
|
||||
# Welcome!
|
||||
|
||||
## Content
|
||||
- [/docs/api](../docs/api) contains autogenerated documentation of our codebase using [typedoc](https://typedoc.org/)
|
||||
- [/docs/guide](../docs/guide) contains a basic startup guide and details to get started with sern faster!
|
||||
|
||||
:::tip
|
||||
This site is open source! Please do contribute if you find any bugs, typos, or sections in need of improvements.
|
||||
:::
|
||||
171
docusaurus.config.js
Normal file
171
docusaurus.config.js
Normal file
@@ -0,0 +1,171 @@
|
||||
// @ts-check
|
||||
// Note: type annotations allow type checking and IDEs autocompletion
|
||||
|
||||
const lightCodeTheme = require('prism-react-renderer/themes/nightOwlLight');
|
||||
const darkCodeTheme = require('prism-react-renderer/themes/oceanicNext');
|
||||
|
||||
/** @type {import('@docusaurus/types').Config} */
|
||||
const config = {
|
||||
title: 'sern - Handlers. Redefined.',
|
||||
tagline: 'With the support of the community made plugins and powerful a CLI, it\'s more than just a handler.',
|
||||
url: 'https://sern-handler.js.org',
|
||||
baseUrl: '/',
|
||||
onBrokenLinks: 'throw',
|
||||
onBrokenMarkdownLinks: 'warn',
|
||||
favicon: 'static/img/favicon.ico', // this currently not working
|
||||
|
||||
// GitHub pages deployment config.
|
||||
// If you aren't using GitHub pages, you don't need these.
|
||||
organizationName: 'sern-handler', // Usually your GitHub org/user name.
|
||||
projectName: '@sern-handler/handler', // Usually your repo name.
|
||||
|
||||
// Even if you don't use internalization, you can use this field to set useful
|
||||
// metadata like html lang. For example, if your site is Chinese, you may want
|
||||
// to replace "en" with "zh-Hans".
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en', 'fr', 'tr'],
|
||||
},
|
||||
|
||||
presets: [
|
||||
[
|
||||
'classic',
|
||||
/** @type {import('@docusaurus/preset-classic').Options} */
|
||||
({
|
||||
docs: {
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
// Please change this to your repo.
|
||||
// Remove this to remove the "edit this page" links.
|
||||
editUrl:
|
||||
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
|
||||
},
|
||||
blog: {
|
||||
showReadingTime: true,
|
||||
// Please change this to your repo.
|
||||
// Remove this to remove the "edit this page" links.
|
||||
editUrl:
|
||||
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
|
||||
},
|
||||
pages : {
|
||||
path: 'src/pages',
|
||||
routeBasePath: '/',
|
||||
include: ['**/*.{js,jsx,ts,tsx,md,mdx}'],
|
||||
exclude: [
|
||||
'**/_*.{js,jsx,ts,tsx,md,mdx}',
|
||||
'**/_*/**',
|
||||
'**/*.test.{js,jsx,ts,tsx}',
|
||||
'**/__tests__/**',
|
||||
],
|
||||
},
|
||||
theme: {
|
||||
customCss: require.resolve('./src/css/custom.css'),
|
||||
},
|
||||
}),
|
||||
],
|
||||
],
|
||||
|
||||
themeConfig:
|
||||
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
|
||||
({
|
||||
navbar: {
|
||||
title: 'home',
|
||||
logo: {
|
||||
alt: 'logo logo',
|
||||
src: 'img/favicon.ico',
|
||||
},
|
||||
items: [
|
||||
{
|
||||
type: 'doc',
|
||||
docId: 'intro',
|
||||
position: 'left',
|
||||
label: 'docs & guide',
|
||||
},
|
||||
//{to: '/blog', label: 'blog', position: 'left'},
|
||||
{
|
||||
href: 'https://github.com/sern-handler',
|
||||
label: 'GitHub',
|
||||
position: 'right',
|
||||
},
|
||||
{
|
||||
to: '/plugins',
|
||||
label: 'plugins',
|
||||
position: 'left'
|
||||
}
|
||||
],
|
||||
},
|
||||
footer: {
|
||||
style: 'dark',
|
||||
links: [
|
||||
{
|
||||
title: 'Information',
|
||||
items: [
|
||||
{
|
||||
label: 'docs & guide',
|
||||
to: '/docs/intro',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Community',
|
||||
items: [
|
||||
{
|
||||
label: 'Stack Overflow',
|
||||
href: 'https://stackoverflow.com/questions/tagged/sern-handler',
|
||||
},
|
||||
{
|
||||
label: 'Discord',
|
||||
href: 'https://discord.gg/DwbF5H5JgQ',
|
||||
},
|
||||
{
|
||||
label : 'Open Collective',
|
||||
href: 'https://opencollective.com/sern'
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'More',
|
||||
items: [
|
||||
// { //this was causing the build err
|
||||
// label: 'blog',
|
||||
// to: '/blog',
|
||||
// },
|
||||
{
|
||||
label: 'GitHub',
|
||||
href: 'https://github.com/sern-handler',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
copyright: `Built with ❤️ by Team sern Handler`,
|
||||
},
|
||||
metadata : [
|
||||
{ name : 'og:title', content : 'sern - Handlers. Redefined.' },
|
||||
{ name : 'og:description', content : 'A customizable, batteries-included, powerful discord.js framework to automate and streamline bot development' },
|
||||
{ name : 'og:image', content : './assets/images/logo.png' },
|
||||
{ name : 'og:url', content : 'https://sern-handler.js.org' },
|
||||
{ name : 'og:type', content : 'website' },
|
||||
{ name : 'twitter:card', content : 'summary_large_image' },
|
||||
{ name : 'twitter:site', content : '@sern-handler' },
|
||||
{ name : 'twitter:title', content : 'sern - Handlers. Redefined.' },
|
||||
{ name : 'twitter:description', content : 'A customizable, batteries-included, powerful discord.js framework to automate and streamline bot development' },
|
||||
{ name : 'twitter:image', content : './assets/images/logo.png' },
|
||||
{ name : 'twitter:url', content : 'https://sern-handler.js.org' },
|
||||
],
|
||||
prism: {
|
||||
theme: lightCodeTheme,
|
||||
darkTheme: darkCodeTheme,
|
||||
},
|
||||
}),
|
||||
// plugins : [
|
||||
// [
|
||||
// 'docusaurus-plugin-typedoc',
|
||||
// {
|
||||
// //if you're editing website, please change this to your local branch of sern to generate documentation
|
||||
// entryPoints: ['../sernHandlerV2/src/index.ts'],
|
||||
// tsconfig: '../sernHandlerV2/tsconfig-base.json',
|
||||
// },
|
||||
// ]
|
||||
// ]
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
@@ -1,317 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script defer>
|
||||
(() => {
|
||||
const { classList } = document.documentElement;
|
||||
const userMode = localStorage.getItem('guide-color-scheme');
|
||||
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||||
classList.toggle('dark', true);
|
||||
}
|
||||
|
||||
const themes = ['blurple'];
|
||||
let colorTheme = localStorage.getItem('guide-color-theme');
|
||||
|
||||
if (colorTheme !== 'default' && !themes.includes(colorTheme)) {
|
||||
colorTheme = 'default';
|
||||
}
|
||||
|
||||
if (colorTheme !== 'default') classList.add(`guide-theme-${colorTheme}`);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="./../../assets/css/gstyle.css">
|
||||
<link rel="icon" href="./../../assets/images/icon.png">
|
||||
<meta name="theme-color" content="#3eaf7c">
|
||||
<meta name="twitter:card" content="summary">
|
||||
|
||||
<meta property="og:title" content="sern Guide">
|
||||
<meta property="og:description" content="sern’s clean, modern and user-friendly guide.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://sern-handler.js.org/guide-en/">
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta name="description" content="sern’s clean, modern and user-friendly user guide.">
|
||||
|
||||
<title>sern-config | Guide</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="theme-container">
|
||||
<header class="navbar">
|
||||
<div class="navbar-wrapper">
|
||||
<div class="navbar-links-wrapper">
|
||||
<div class="navbar-links-container"><span class="navbar-links-home">
|
||||
<a aria-current="page" href="/" class="router-link-active router-link-exact-active">
|
||||
<img src="./../../assets/images/icon.png" style="width: 45px; margin-top: 7px;">
|
||||
</a>
|
||||
</span>
|
||||
<nav class="navbar-links can-hide">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Documentation
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://discord.com/invite/QgnfxWzrcj"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Discord Server
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external"
|
||||
href="https://github.com/sern-handler/handler" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="navbar-links-container">
|
||||
<div id="docsearch-container" class="navbar-search"><button type="button"
|
||||
class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg
|
||||
width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
|
||||
stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round"
|
||||
stroke-linejoin="round"></path>
|
||||
</svg><span class="DocSearch-Button-Placeholder">Search the guide</span></span></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="toggle-sidebar-button"><svg viewBox="0 0 448 512" class="icon sidebar-menu-icon">
|
||||
<path fill="currentColor"
|
||||
d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z">
|
||||
</path>
|
||||
</svg><svg viewBox="0 0 24 24" class="icon sidebar-close-icon">
|
||||
<path
|
||||
d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<button class="toggle-dark-button"><svg class="icon light-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z"
|
||||
fill="currentColor"></path>
|
||||
<path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path>
|
||||
<path d="M2 15.005h5v2H2z" fill="currentColor"></path>
|
||||
<path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 25.005h2v5h-2z" fill="currentColor"></path>
|
||||
<path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path>
|
||||
<path d="M25 15.005h5v2h-5z" fill="currentColor"></path>
|
||||
<path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 2.005h2v5h-2z" fill="currentColor"></path>
|
||||
</svg><svg class="icon dark-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path
|
||||
d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<div class="notifications-wrapper">
|
||||
<div class="notifications">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-mask"></div>
|
||||
<div class="sidebar-wrapper">
|
||||
<aside class="sidebar">
|
||||
<nav class="navbar-links">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
|
||||
Documentation <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://github.com/sern-handler/website"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
</nav>
|
||||
<ul class="sidebar-links">
|
||||
<p class="sidebar-heading sidebar-item active">Welcome to sern</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a aria-current="page" href="../intro.html"
|
||||
class="router-link-active router-link-exact-active nav-link sidebar-item active"
|
||||
aria-label="Introduction">
|
||||
Introduction
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../other/release-notes.html" class="nav-link sidebar-item" aria-label="What's new">
|
||||
Release notes
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Walkthroughs</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a href="../walkthroughs/cli.html" class="nav-link sidebar-item" aria-label="Initial files">
|
||||
Understanding the CLI
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../walkthroughs/first-command.html" class="nav-link sidebar-item"
|
||||
aria-label="Creating commands">
|
||||
Your first command
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../walkthroughs/first-event.html" class="nav-link sidebar-item"
|
||||
aria-label="Command handling">
|
||||
Your first event
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Working with plugins
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
SernEmitter
|
||||
<!-- SernEmitter is the name of a class!! -->
|
||||
</a>
|
||||
</li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Conclusion
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Good to know</p>
|
||||
<ul class="">
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
sern.config.json
|
||||
</a>
|
||||
</li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
<main class="page">
|
||||
<div class="theme-default-content">
|
||||
<h1 id="introduction" tabindex="-1"><a class="header-anchor" href="#notes" aria-hidden="true">#</a>
|
||||
sern.config.json</h1>
|
||||
<p>This config file, although not necessary, allows your project to communicate with our cli. For example,
|
||||
when installing typescript plugins, the language property is necessary to install from our open source
|
||||
repository. Using the cli and running sern init --sync on pre-existing projects should install this json
|
||||
file in the root directory given. Or, if this is a brand-new project, sern init automatically installs it.
|
||||
</p>
|
||||
<footer class="page-meta">
|
||||
<div class="meta-item edit-link"><a class="nav-link external meta-item-label"
|
||||
href="https://github.com/sern-handler/website/" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="Edit this page">
|
||||
|
||||
Edit this page <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="meta-item last-updated"><span class="meta-item-label">Last Updated at </span>
|
||||
<span class="meta-item-info">18/07/2022, 11:48 PM</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<nav class="page-nav">
|
||||
<p class="inner">
|
||||
<span class="prev">
|
||||
<a href="/guide-en/other/release-notes.html" class="nav-link" aria-label="Relase Notes">
|
||||
← View previous page
|
||||
</a>
|
||||
</span>
|
||||
<span class="next">
|
||||
<a href="/guide-en/walkthroughs/first-event.html" class="nav-link" aria-label="First event">
|
||||
View next page →
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
</nav>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/assets/app.a2fc1d97.js" defer=""></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,322 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script defer>
|
||||
(() => {
|
||||
const { classList } = document.documentElement;
|
||||
const userMode = localStorage.getItem('guide-color-scheme');
|
||||
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||||
classList.toggle('dark', true);
|
||||
}
|
||||
|
||||
const themes = ['blurple'];
|
||||
let colorTheme = localStorage.getItem('guide-color-theme');
|
||||
|
||||
if (colorTheme !== 'default' && !themes.includes(colorTheme)) {
|
||||
colorTheme = 'default';
|
||||
}
|
||||
|
||||
if (colorTheme !== 'default') classList.add(`guide-theme-${colorTheme}`);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="./../assets/css/gstyle.css">
|
||||
<link rel="icon" href="./../assets/images/icon.png">
|
||||
<meta name="theme-color" content="#fff">
|
||||
<meta name="twitter:card" content="summary">
|
||||
|
||||
<meta property="og:title" content="sern Guide">
|
||||
<meta property="og:description" content="sern’s clean, modern and user-friendly guide.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://sern-handler.js.org/guide-en/">
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta name="description" content="sern’s clean, modern and user-friendly user guide.">
|
||||
|
||||
<title>Introduction | Guide</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="theme-container">
|
||||
<header class="navbar">
|
||||
<div class="navbar-wrapper">
|
||||
<div class="navbar-links-wrapper">
|
||||
<div class="navbar-links-container"><span class="navbar-links-home">
|
||||
<a aria-current="page" href="/" class="router-link-active router-link-exact-active">
|
||||
<img src="./../assets/images/icon.png" style="width: 45px; margin-top: 7px;">
|
||||
</a>
|
||||
</span>
|
||||
<nav class="navbar-links can-hide">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Documentation
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://discord.com/invite/QgnfxWzrcj"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Discord Server
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external"
|
||||
href="https://github.com/sern-handler/handler" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="navbar-links-container">
|
||||
<div id="docsearch-container" class="navbar-search"><button type="button"
|
||||
class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg
|
||||
width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
|
||||
stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round"
|
||||
stroke-linejoin="round"></path>
|
||||
</svg><span class="DocSearch-Button-Placeholder">Search the guide</span></span></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="toggle-sidebar-button"><svg viewBox="0 0 448 512" class="icon sidebar-menu-icon">
|
||||
<path fill="currentColor"
|
||||
d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z">
|
||||
</path>
|
||||
</svg><svg viewBox="0 0 24 24" class="icon sidebar-close-icon">
|
||||
<path
|
||||
d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<button class="toggle-dark-button"><svg class="icon light-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z"
|
||||
fill="currentColor"></path>
|
||||
<path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path>
|
||||
<path d="M2 15.005h5v2H2z" fill="currentColor"></path>
|
||||
<path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 25.005h2v5h-2z" fill="currentColor"></path>
|
||||
<path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path>
|
||||
<path d="M25 15.005h5v2h-5z" fill="currentColor"></path>
|
||||
<path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 2.005h2v5h-2z" fill="currentColor"></path>
|
||||
</svg><svg class="icon dark-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path
|
||||
d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<div class="notifications-wrapper">
|
||||
<div class="notifications">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-mask"></div>
|
||||
<div class="sidebar-wrapper">
|
||||
<aside class="sidebar">
|
||||
<nav class="navbar-links">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
|
||||
Documentation <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://github.com/sern-handler/website"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
</nav>
|
||||
<ul class="sidebar-links">
|
||||
<p class="sidebar-heading sidebar-item active">Welcome to sern</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a aria-current="page" href="./intro.html"
|
||||
class="router-link-active router-link-exact-active nav-link sidebar-item active"
|
||||
aria-label="Introduction">
|
||||
Introduction
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./other/release-notes.html" class="nav-link sidebar-item" aria-label="What's new">
|
||||
Release notes
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Walkthroughs</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a href="./walkthroughs/cli.html" class="nav-link sidebar-item" aria-label="Initial files">
|
||||
Understanding the CLI
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./walkthroughs/first-command.html" class="nav-link sidebar-item"
|
||||
aria-label="Creating commands">
|
||||
Your first command
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./walkthroughs/first-event.html" class="nav-link sidebar-item" aria-label="Command handling">
|
||||
Your first event
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Working with plugins
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
SernEmitter
|
||||
<!-- SernEmitter is the name of a class!! -->
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Conclusion
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Good to know</p>
|
||||
<ul class="">
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
sern.config.json
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
<main class="page">
|
||||
<div class="theme-default-content">
|
||||
<h1 id="introduction" tabindex="-1"><a class="header-anchor" href="#introduction" aria-hidden="true">#</a>
|
||||
Introduction</h1>
|
||||
<p>Welcome to sern’s official guide. This guide will go through all the core features of the framework.</p>
|
||||
<ul>
|
||||
<li>💖 Thank you for choosing sern to be your framework!</li>
|
||||
<li>Teaching the discord.js library and/or Javascript/Typescript is out of scope of this project, so the
|
||||
guide assumes you already know these elements.
|
||||
</li>
|
||||
<li>discord.js v14 is the only supported version at the moment. There are plans to roll out a version of
|
||||
sern in discord.js@13.9 in the future.</li>
|
||||
</ul>
|
||||
<p>This guide will also cover subjects like common errors and how to solve them, keeping your code clean,
|
||||
setting up a proper development environment, etc. Sounds good? Great! Let's get started, then.</p>
|
||||
<h2 id="before-you-begin" tabindex="-1"><a class="header-anchor" href="#before-you-begin"
|
||||
aria-hidden="true">#</a>Explore</h2>
|
||||
<ul>
|
||||
<li>What is sern? & sern's Goal</li>
|
||||
<li>How to use the <a href="./walkthroughs/cli.html">CLI</a></li>
|
||||
<li>Getting started</li>
|
||||
<li>What is a plugin and how to use it</li>
|
||||
<li>the sern.config.json file</li>
|
||||
</div>
|
||||
<footer class="page-meta">
|
||||
<div class="meta-item edit-link"><a class="nav-link external meta-item-label"
|
||||
href="https://github.com/sern-handler/website/" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="Edit this page">
|
||||
|
||||
Edit this page <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="meta-item last-updated"><span class="meta-item-label">Last Updated at </span>
|
||||
<span class="meta-item-info">18/07/2022, 11:48 PM</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<nav class="page-nav">
|
||||
<p class="inner">
|
||||
<span class="next">
|
||||
<a href="/guide-en/other/release-notes.html" class="nav-link" aria-label="Relase notes">
|
||||
View next page →
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
</nav>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/assets/app.a2fc1d97.js" defer=""></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,315 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script defer>
|
||||
(() => {
|
||||
const { classList } = document.documentElement;
|
||||
const userMode = localStorage.getItem('guide-color-scheme');
|
||||
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||||
classList.toggle('dark', true);
|
||||
}
|
||||
|
||||
const themes = ['blurple'];
|
||||
let colorTheme = localStorage.getItem('guide-color-theme');
|
||||
|
||||
if (colorTheme !== 'default' && !themes.includes(colorTheme)) {
|
||||
colorTheme = 'default';
|
||||
}
|
||||
|
||||
if (colorTheme !== 'default') classList.add(`guide-theme-${colorTheme}`);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="./../../assets/css/gstyle.css">
|
||||
<link rel="icon" href="./../../assets/images/icon.png">
|
||||
<meta name="theme-color" content="#3eaf7c">
|
||||
<meta name="twitter:card" content="summary">
|
||||
|
||||
<meta property="og:title" content="sern Guide">
|
||||
<meta property="og:description" content="sern’s clean, modern and user-friendly guide.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://sern-handler.js.org/guide-en/">
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta name="description" content="sern’s clean, modern and user-friendly user guide.">
|
||||
|
||||
<title>Release Notes | Guide</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="theme-container">
|
||||
<header class="navbar">
|
||||
<div class="navbar-wrapper">
|
||||
<div class="navbar-links-wrapper">
|
||||
<div class="navbar-links-container"><span class="navbar-links-home">
|
||||
<a aria-current="page" href="/" class="router-link-active router-link-exact-active">
|
||||
<img src="./../../assets/images/icon.png" style="width: 45px; margin-top: 7px;">
|
||||
</a>
|
||||
</span>
|
||||
<nav class="navbar-links can-hide">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Documentation
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://discord.com/invite/QgnfxWzrcj"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Discord Server
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external"
|
||||
href="https://github.com/sern-handler/handler" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="navbar-links-container">
|
||||
<div id="docsearch-container" class="navbar-search"><button type="button"
|
||||
class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg
|
||||
width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
|
||||
stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round"
|
||||
stroke-linejoin="round"></path>
|
||||
</svg><span class="DocSearch-Button-Placeholder">Search the guide</span></span></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="toggle-sidebar-button"><svg viewBox="0 0 448 512" class="icon sidebar-menu-icon">
|
||||
<path fill="currentColor"
|
||||
d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z">
|
||||
</path>
|
||||
</svg><svg viewBox="0 0 24 24" class="icon sidebar-close-icon">
|
||||
<path
|
||||
d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<button class="toggle-dark-button"><svg class="icon light-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z"
|
||||
fill="currentColor"></path>
|
||||
<path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path>
|
||||
<path d="M2 15.005h5v2H2z" fill="currentColor"></path>
|
||||
<path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 25.005h2v5h-2z" fill="currentColor"></path>
|
||||
<path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path>
|
||||
<path d="M25 15.005h5v2h-5z" fill="currentColor"></path>
|
||||
<path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 2.005h2v5h-2z" fill="currentColor"></path>
|
||||
</svg><svg class="icon dark-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path
|
||||
d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<div class="notifications-wrapper">
|
||||
<div class="notifications">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-mask"></div>
|
||||
<div class="sidebar-wrapper">
|
||||
<aside class="sidebar">
|
||||
<nav class="navbar-links">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
|
||||
Documentation <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://github.com/sern-handler/website"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
</nav>
|
||||
<ul class="sidebar-links">
|
||||
<p class="sidebar-heading sidebar-item active">Welcome to sern</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a aria-current="page" href="../intro.html"
|
||||
class="router-link-active router-link-exact-active nav-link sidebar-item active"
|
||||
aria-label="Introduction">
|
||||
Introduction
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./release-notes.html" class="nav-link sidebar-item" aria-label="What's new">
|
||||
Release notes
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Walkthroughs</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a href="../walkthroughs/cli.html" class="nav-link sidebar-item" aria-label="Initial files">
|
||||
Understanding the CLI
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../walkthroughs/first-command.html" class="nav-link sidebar-item"
|
||||
aria-label="Creating commands">
|
||||
Your first command
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../walkthroughs/first-event.html" class="nav-link sidebar-item"
|
||||
aria-label="Command handling">
|
||||
Your first event
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Working with plugins
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
SernEmitter
|
||||
<!-- SernEmitter is the name of a class!! -->
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Conclusion
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Good to know</p>
|
||||
<ul class="">
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
sern.config.json
|
||||
</a>
|
||||
</li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
<main class="page">
|
||||
<div class="theme-default-content">
|
||||
<h1 id="introduction" tabindex="-1"><a class="header-anchor" href="#introduction" aria-hidden="true">#</a>
|
||||
Relase Notes</h1>
|
||||
<p>v2.0.0 (Website)</p>
|
||||
<p>{ status: 404, code: "Not found" }</p>
|
||||
</div>
|
||||
<footer class="page-meta">
|
||||
<div class="meta-item edit-link"><a class="nav-link external meta-item-label"
|
||||
href="https://github.com/sern-handler/website/" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="Edit this page">
|
||||
|
||||
Edit this page <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="meta-item last-updated"><span class="meta-item-label">Last Updated at </span>
|
||||
<span class="meta-item-info">18/07/2022, 11:48 PM</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<nav class="page-nav">
|
||||
<p class="inner">
|
||||
<span class="prev">
|
||||
<a href="/guide-en/intro.html" class="nav-link" aria-label="Requesting more content">
|
||||
← View previous page
|
||||
</a>
|
||||
</span>
|
||||
<span class="next">
|
||||
<a href="/guide-en/walkthroughs/cli.html" class="nav-link" aria-label="Requesting more content">
|
||||
View next page →
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
</nav>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/assets/app.a2fc1d97.js" defer=""></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,340 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script defer>
|
||||
(() => {
|
||||
const { classList } = document.documentElement;
|
||||
const userMode = localStorage.getItem('guide-color-scheme');
|
||||
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||||
classList.toggle('dark', true);
|
||||
}
|
||||
|
||||
const themes = ['blurple'];
|
||||
let colorTheme = localStorage.getItem('guide-color-theme');
|
||||
|
||||
if (colorTheme !== 'default' && !themes.includes(colorTheme)) {
|
||||
colorTheme = 'default';
|
||||
}
|
||||
|
||||
if (colorTheme !== 'default') classList.add(`guide-theme-${colorTheme}`);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="./../../assets/css/gstyle.css">
|
||||
<link rel="icon" href="./../../assets/images/icon.png">
|
||||
<meta name="theme-color" content="#3eaf7c">
|
||||
<meta name="twitter:card" content="summary">
|
||||
|
||||
<meta property="og:title" content="sern Guide">
|
||||
<meta property="og:description" content="sern’s clean, modern and user-friendly guide.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://sern-handler.js.org/guide-en/">
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta name="description" content="sern’s clean, modern and user-friendly user guide.">
|
||||
|
||||
<title>CLI | Guide</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="theme-container">
|
||||
<header class="navbar">
|
||||
<div class="navbar-wrapper">
|
||||
<div class="navbar-links-wrapper">
|
||||
<div class="navbar-links-container"><span class="navbar-links-home">
|
||||
<a aria-current="page" href="/" class="router-link-active router-link-exact-active">
|
||||
<img src="./../../assets/images/icon.png" style="width: 45px; margin-top: 7px;">
|
||||
</a>
|
||||
</span>
|
||||
<nav class="navbar-links can-hide">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Documentation
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://discord.com/invite/QgnfxWzrcj"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Discord Server
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external"
|
||||
href="https://github.com/sern-handler/handler" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="navbar-links-container">
|
||||
<div id="docsearch-container" class="navbar-search"><button type="button"
|
||||
class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg
|
||||
width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
|
||||
stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round"
|
||||
stroke-linejoin="round"></path>
|
||||
</svg><span class="DocSearch-Button-Placeholder">Search the guide</span></span></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="toggle-sidebar-button"><svg viewBox="0 0 448 512" class="icon sidebar-menu-icon">
|
||||
<path fill="currentColor"
|
||||
d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z">
|
||||
</path>
|
||||
</svg><svg viewBox="0 0 24 24" class="icon sidebar-close-icon">
|
||||
<path
|
||||
d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<button class="toggle-dark-button"><svg class="icon light-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z"
|
||||
fill="currentColor"></path>
|
||||
<path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path>
|
||||
<path d="M2 15.005h5v2H2z" fill="currentColor"></path>
|
||||
<path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 25.005h2v5h-2z" fill="currentColor"></path>
|
||||
<path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path>
|
||||
<path d="M25 15.005h5v2h-5z" fill="currentColor"></path>
|
||||
<path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 2.005h2v5h-2z" fill="currentColor"></path>
|
||||
</svg><svg class="icon dark-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path
|
||||
d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<div class="notifications-wrapper">
|
||||
<div class="notifications">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-mask"></div>
|
||||
<div class="sidebar-wrapper">
|
||||
<aside class="sidebar">
|
||||
<nav class="navbar-links">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
|
||||
Documentation <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://github.com/sern-handler/website"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
</nav>
|
||||
<ul class="sidebar-links">
|
||||
<p class="sidebar-heading sidebar-item active">Welcome to sern</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a aria-current="page" href="../intro.html"
|
||||
class="router-link-active router-link-exact-active nav-link sidebar-item active"
|
||||
aria-label="Introduction">
|
||||
Introduction
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../other/release-notes.html" class="nav-link sidebar-item" aria-label="What's new">
|
||||
Release notes
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Walkthroughs</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a href="./cli.html" class="nav-link sidebar-item" aria-label="Initial files">
|
||||
Understanding the CLI
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./first-command.html" class="nav-link sidebar-item" aria-label="Creating commands">
|
||||
Your first command
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./first-event.html" class="nav-link sidebar-item" aria-label="Command handling">
|
||||
Your first event
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Working with plugins
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
SernEmitter
|
||||
<!-- SernEmitter is the name of a class!! -->
|
||||
</a>
|
||||
</li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Conclusion
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Good to know</p>
|
||||
<ul class="">
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
sern.config.json
|
||||
</a>
|
||||
</li>
|
||||
<a href="../creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
<main class="page">
|
||||
<div class="theme-default-content">
|
||||
<h1 id="cli" tabindex="-1"><a class="header-anchor" href="#cli" aria-hidden="true">#</a>
|
||||
sern CLI</h1>
|
||||
<p>Setting up the CLI is easy.</p>
|
||||
|
||||
<div class="language-shell ext-sh line-numbers-mode">
|
||||
<pre class="language-shell"><code>npm install -g @sern/cli</code></pre>
|
||||
<div class="line-numbers"><span class="line-number">1</span></div>
|
||||
</div>
|
||||
<br>
|
||||
<p>To start a new project, run:</p>
|
||||
<div class="language-shell ext-sh line-numbers-mode">
|
||||
<pre class="language-shell"><code>sern init</code></pre>
|
||||
<div class="line-numbers"><span class="line-number">1</span></div>
|
||||
</div>
|
||||
<p>Include the -y flag if you want to set up defaults. The default langauge is Typescript</p>
|
||||
|
||||
<br>
|
||||
<div class="language-shell ext-sh line-numbers-mode">
|
||||
<pre class="language-shell"><code>sern plugins</code></pre>
|
||||
<div class="line-numbers"><span class="line-number">1</span></div>
|
||||
</div>
|
||||
<p>This will display a menu selection of all installable plugins. Keep in mind that you must have a
|
||||
sern.config.json to use this command. If you want to view plugins, visit the repository linked above.</p>
|
||||
|
||||
<br>
|
||||
<div class="language-shell ext-sh line-numbers-mode">
|
||||
<pre class="language-shell"><code>sern extra</code></pre>
|
||||
<div class="line-numbers"><span class="line-number">1</span></div>
|
||||
</div>
|
||||
<p>To install extra utilities into your project</p>
|
||||
</div>
|
||||
<footer class="page-meta">
|
||||
<div class="meta-item edit-link"><a class="nav-link external meta-item-label"
|
||||
href="https://github.com/sern-handler/website/" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="Edit this page">
|
||||
|
||||
Edit this page <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="meta-item last-updated"><span class="meta-item-label">Last Updated at </span>
|
||||
<span class="meta-item-info">18/07/2022, 11:48 PM</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<nav class="page-nav">
|
||||
<p class="inner">
|
||||
<span class="prev">
|
||||
<a href="/guide-en/other/release-notes.html" class="nav-link" aria-label="Requesting more content">
|
||||
← View previous page
|
||||
</a>
|
||||
</span>
|
||||
<span class="next">
|
||||
<a href="/guide-en/walkthroughs/first-command.html" class="nav-link"
|
||||
aria-label="Requesting more content">
|
||||
View next page →
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
</nav>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/assets/app.a2fc1d97.js" defer=""></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,307 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script defer>
|
||||
(() => {
|
||||
const { classList } = document.documentElement;
|
||||
const userMode = localStorage.getItem('guide-color-scheme');
|
||||
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||||
classList.toggle('dark', true);
|
||||
}
|
||||
|
||||
const themes = ['blurple'];
|
||||
let colorTheme = localStorage.getItem('guide-color-theme');
|
||||
|
||||
if (colorTheme !== 'default' && !themes.includes(colorTheme)) {
|
||||
colorTheme = 'default';
|
||||
}
|
||||
|
||||
if (colorTheme !== 'default') classList.add(`guide-theme-${colorTheme}`);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="./../../assets/css/gstyle.css">
|
||||
<link rel="icon" href="./../../assets/images/icon.png">
|
||||
<meta name="theme-color" content="#3eaf7c">
|
||||
<meta name="twitter:card" content="summary">
|
||||
|
||||
<meta property="og:title" content="sern Guide">
|
||||
<meta property="og:description" content="sern’s clean, modern and user-friendly guide.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://sern-handler.js.org/guide-en/">
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta name="description" content="sern’s clean, modern and user-friendly user guide.">
|
||||
|
||||
<title>Conclusion | Guide</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="theme-container">
|
||||
<header class="navbar">
|
||||
<div class="navbar-wrapper">
|
||||
<div class="navbar-links-wrapper">
|
||||
<div class="navbar-links-container"><span class="navbar-links-home">
|
||||
<a aria-current="page" href="/" class="router-link-active router-link-exact-active">
|
||||
<img src="./../../assets/images/icon.png" style="width: 45px; margin-top: 7px;">
|
||||
</a>
|
||||
</span>
|
||||
<nav class="navbar-links can-hide">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Documentation
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://discord.com/invite/QgnfxWzrcj"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Discord Server
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external"
|
||||
href="https://github.com/sern-handler/handler" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="navbar-links-container">
|
||||
<div id="docsearch-container" class="navbar-search"><button type="button"
|
||||
class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg
|
||||
width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
|
||||
stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round"
|
||||
stroke-linejoin="round"></path>
|
||||
</svg><span class="DocSearch-Button-Placeholder">Search the guide</span></span></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="toggle-sidebar-button"><svg viewBox="0 0 448 512" class="icon sidebar-menu-icon">
|
||||
<path fill="currentColor"
|
||||
d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z">
|
||||
</path>
|
||||
</svg><svg viewBox="0 0 24 24" class="icon sidebar-close-icon">
|
||||
<path
|
||||
d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<button class="toggle-dark-button"><svg class="icon light-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z"
|
||||
fill="currentColor"></path>
|
||||
<path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path>
|
||||
<path d="M2 15.005h5v2H2z" fill="currentColor"></path>
|
||||
<path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 25.005h2v5h-2z" fill="currentColor"></path>
|
||||
<path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path>
|
||||
<path d="M25 15.005h5v2h-5z" fill="currentColor"></path>
|
||||
<path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 2.005h2v5h-2z" fill="currentColor"></path>
|
||||
</svg><svg class="icon dark-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path
|
||||
d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<div class="notifications-wrapper">
|
||||
<div class="notifications">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-mask"></div>
|
||||
<div class="sidebar-wrapper">
|
||||
<aside class="sidebar">
|
||||
<nav class="navbar-links">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
|
||||
Documentation <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://github.com/sern-handler/website"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
</nav>
|
||||
<ul class="sidebar-links">
|
||||
<p class="sidebar-heading sidebar-item active">Welcome to sern</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a aria-current="page" href="../intro.html"
|
||||
class="router-link-active router-link-exact-active nav-link sidebar-item active"
|
||||
aria-label="Introduction">
|
||||
Introduction
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../other/release-notes.html" class="nav-link sidebar-item" aria-label="What's new">
|
||||
Release notes
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Walkthroughs</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a href="./cli.html" class="nav-link sidebar-item" aria-label="Initial files">
|
||||
Understanding the CLI
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./first-command.html" class="nav-link sidebar-item" aria-label="Creating commands">
|
||||
Your first command
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./first-event.html" class="nav-link sidebar-item" aria-label="Command handling">
|
||||
Your first event
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./event-handling.html" class="nav-link sidebar-item" aria-label="Event handling">
|
||||
Working with plugins
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
SernEmitter
|
||||
<!-- SernEmitter is the name of a class!! -->
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Conclusion
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Good to know</p>
|
||||
<ul class="">
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
sern.config.json
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
<main class="page">
|
||||
<div class="theme-default-content">
|
||||
<h1 id="introduction" tabindex="-1"><a class="header-anchor" href="#notes" aria-hidden="true">#</a>
|
||||
Conclusion</h1>
|
||||
<p>If you reached this far, thank you for reading! We hope you have learned the necessities you need to
|
||||
create a bot with the sern framework. If you have any other questions, bugs, feature requests, concerns,
|
||||
please join our community server, and we'll be glad to answer your questions.</p>
|
||||
<footer class="page-meta">
|
||||
<div class="meta-item edit-link"><a class="nav-link external meta-item-label"
|
||||
href="https://github.com/sern-handler/website/" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="Edit this page">
|
||||
|
||||
Edit this page <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="meta-item last-updated"><span class="meta-item-label">Last Updated at </span>
|
||||
<span class="meta-item-info">18/07/2022, 11:48 PM</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<nav class="page-nav">
|
||||
<p class="inner">
|
||||
<span class="prev">
|
||||
<a href="/guide-en/walkthroughs/plugins.html" class="nav-link" aria-label="Relase Notes">
|
||||
← View previous page
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
</nav>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/assets/app.a2fc1d97.js" defer=""></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,516 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script defer>
|
||||
(() => {
|
||||
const { classList } = document.documentElement;
|
||||
const userMode = localStorage.getItem('guide-color-scheme');
|
||||
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||||
classList.toggle('dark', true);
|
||||
}
|
||||
|
||||
const themes = ['blurple'];
|
||||
let colorTheme = localStorage.getItem('guide-color-theme');
|
||||
|
||||
if (colorTheme !== 'default' && !themes.includes(colorTheme)) {
|
||||
colorTheme = 'default';
|
||||
}
|
||||
|
||||
if (colorTheme !== 'default') classList.add(`guide-theme-${colorTheme}`);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="./../../assets/css/gstyle.css">
|
||||
<link rel="icon" href="./../../assets/images/icon.png">
|
||||
<meta name="theme-color" content="#3eaf7c">
|
||||
<meta name="twitter:card" content="summary">
|
||||
|
||||
<meta property="og:title" content="sern Guide">
|
||||
<meta property="og:description" content="sern’s clean, modern and user-friendly guide.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://sern-handler.js.org/guide-en/">
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta name="description" content="sern’s clean, modern and user-friendly user guide.">
|
||||
|
||||
<title>First Command | Guide</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="theme-container">
|
||||
<header class="navbar">
|
||||
<div class="navbar-wrapper">
|
||||
<div class="navbar-links-wrapper">
|
||||
<div class="navbar-links-container"><span class="navbar-links-home">
|
||||
<a aria-current="page" href="/" class="router-link-active router-link-exact-active">
|
||||
<img src="./../../assets/images/icon.png" style="width: 45px; margin-top: 7px;">
|
||||
</a>
|
||||
</span>
|
||||
<nav class="navbar-links can-hide">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Documentation
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://discord.com/invite/QgnfxWzrcj"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Discord Server
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external"
|
||||
href="https://github.com/sern-handler/handler" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="navbar-links-container">
|
||||
<div id="docsearch-container" class="navbar-search"><button type="button"
|
||||
class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg
|
||||
width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
|
||||
stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round"
|
||||
stroke-linejoin="round"></path>
|
||||
</svg><span class="DocSearch-Button-Placeholder">Search the guide</span></span></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="toggle-sidebar-button"><svg viewBox="0 0 448 512" class="icon sidebar-menu-icon">
|
||||
<path fill="currentColor"
|
||||
d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z">
|
||||
</path>
|
||||
</svg><svg viewBox="0 0 24 24" class="icon sidebar-close-icon">
|
||||
<path
|
||||
d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<button class="toggle-dark-button"><svg class="icon light-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z"
|
||||
fill="currentColor"></path>
|
||||
<path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path>
|
||||
<path d="M2 15.005h5v2H2z" fill="currentColor"></path>
|
||||
<path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 25.005h2v5h-2z" fill="currentColor"></path>
|
||||
<path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path>
|
||||
<path d="M25 15.005h5v2h-5z" fill="currentColor"></path>
|
||||
<path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 2.005h2v5h-2z" fill="currentColor"></path>
|
||||
</svg><svg class="icon dark-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path
|
||||
d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<div class="notifications-wrapper">
|
||||
<div class="notifications">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-mask"></div>
|
||||
<div class="sidebar-wrapper">
|
||||
<aside class="sidebar">
|
||||
<nav class="navbar-links">
|
||||
<div class="navbar-links-item"><a class="nav-link external"
|
||||
href="https://sern-handler.js.org/#/docs/main/stable/general/welcome" rel="noopener noreferrer"
|
||||
target="_blank" aria-label="Documentation">
|
||||
|
||||
Documentation <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://github.com/sern-handler/website"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
</nav>
|
||||
<ul class="sidebar-links">
|
||||
<p class="sidebar-heading sidebar-item active">Welcome to sern</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a aria-current="page" href="./intro.html"
|
||||
class="router-link-active router-link-exact-active nav-link sidebar-item active"
|
||||
aria-label="Introduction">
|
||||
Introduction
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../other/release-notes.html" class="nav-link sidebar-item" aria-label="What's new">
|
||||
Release notes
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Walkthroughs</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a href="./cli.html" class="nav-link sidebar-item" aria-label="Initial files">
|
||||
Understanding the CLI
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./first-command.html" class="nav-link sidebar-item" aria-label="Creating commands">
|
||||
Your first command
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./first-event.html" class="nav-link sidebar-item" aria-label="Command handling">
|
||||
Your first event
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Working with plugins
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
SernEmitter
|
||||
<!-- SernEmitter is the name of a class!! -->
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Conclusion
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Good to know</p>
|
||||
<ul class="">
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
sern.config.json
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
<main class="page">
|
||||
<div class="theme-default-content">
|
||||
<h1 id="first-command" tabindex="-1"><a class="header-anchor" href="#first-command" aria-hidden="true">#</a>
|
||||
First Command</h1>
|
||||
<p>We will dissect a basic command. If you installed a new project via the cli, This is the `ping` command
|
||||
located in src/commands folder.</p>
|
||||
<div class="code-group">
|
||||
<div class="code-group__nav">
|
||||
<ul class="code-group__ul">
|
||||
<li class="code-group__li"><button class="code-group__nav-tab code-group__nav-tab-active"
|
||||
aria-pressed="true" aria-expanded="true">ping.js</button></li>
|
||||
<li class="code-group__li"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="code-group-item code-group-item__active" aria-selected="true">
|
||||
<div class="language-javascript ext-js line-numbers-mode">
|
||||
<pre class="language-javascript">
|
||||
<code><span class="token keyword">const</span> { CommandType, commandModule } = <span class="token function">require</span>('@sern/handler');
|
||||
|
||||
<span class="token keyword">exports</span>.default = commandModule({
|
||||
type: CommandType.Both,
|
||||
plugins: [],
|
||||
description: 'A ping command',
|
||||
// alias : [],
|
||||
execute: async (ctx, args) => {
|
||||
await ctx.reply('Pong 🏓');
|
||||
},
|
||||
});
|
||||
</code></pre>
|
||||
<div class="highlight-lines"><br><br><br>
|
||||
<div class="highlight-line"> </div><br>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div><br><br><br><br><br>
|
||||
</div>
|
||||
<div class="line-numbers"><span class="line-number">1</span><br><span
|
||||
class="line-number">2</span><br><span class="line-number">3</span><br><span
|
||||
class="line-number">4</span><br><span class="line-number">5</span><br><span
|
||||
class="line-number">6</span><br><span class="line-number">7</span><br><span
|
||||
class="line-number">8</span><br><span class="line-number">9</span><br><span
|
||||
class="line-number">10</span><br><span class="line-number">11</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="code-group-item" aria-selected="false">
|
||||
<div class="language-json ext-json line-numbers-mode">
|
||||
<pre class="language-json"><code><span class="token punctuation">{</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre>
|
||||
<div class="highlight-lines"><br>
|
||||
<div class="highlight-line"> </div>
|
||||
<div class="highlight-line"> </div><br><br>
|
||||
</div>
|
||||
<div class="line-numbers"><span class="line-number">1</span><br><span
|
||||
class="line-number">2</span><br><span class="line-number">3</span><br>
|
||||
<span class="line-number">4</span><br><span class="line-number">5</span><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 id="ftypes" tabindex="-1"><a class="header-anchor" href="#ftypes" aria-hidden="true">#</a>
|
||||
Types of commandModules</h2>
|
||||
<p>Every command module type is part of an enum. This field allows type inference for the rest of a module's
|
||||
fields.
|
||||
All the command types can be found in the official documentation!
|
||||
|
||||
So, lets say you want to make a command module that listens to modals.
|
||||
|
||||
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.</p>
|
||||
<div class="code-group">
|
||||
<div class="code-group__nav">
|
||||
<ul class="code-group__ul">
|
||||
<li class="code-group__li"><button class="code-group__nav-tab code-group__nav-tab-active"
|
||||
aria-pressed="true" aria-expanded="true">cmd.js</button></li>
|
||||
<li class="code-group__li"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="code-group-item code-group-item__active" aria-selected="true">
|
||||
<div class="language-javascript ext-js line-numbers-mode">
|
||||
<pre class="language-javascript">
|
||||
<code><span class="token keyword">const</span> { CommandType, commandModule } = <span class="token function">require</span>('@sern/handler');
|
||||
|
||||
<span class="token keyword">exports</span>.default = commandModule({
|
||||
name: 'dm-me',
|
||||
type: CommandType.Modal,
|
||||
async execute (modal) {
|
||||
const value = modal.fields.getTextInputValue('message');
|
||||
modal.client.users.fetch('182326315813306368').then( u =>
|
||||
u.send(value + ` from ${modal.user}`)
|
||||
);
|
||||
modal.reply( { ephemeral:true, content: 'Sent' })
|
||||
}
|
||||
});
|
||||
</code></pre>
|
||||
<div class="highlight-lines"><br><br><br>
|
||||
<div class="highlight-line"> </div><br>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div><br><br><br><br><br>
|
||||
</div>
|
||||
<div class="line-numbers"><span class="line-number">1</span><br><span
|
||||
class="line-number">2</span><br><span class="line-number">3</span><br><span
|
||||
class="line-number">4</span><br><span class="line-number">5</span><br><span
|
||||
class="line-number">6</span><br><span class="line-number">7</span><br><span
|
||||
class="line-number">8</span><br><span class="line-number">9</span><br><span
|
||||
class="line-number">10</span><br><span class="line-number">11</span><br><span
|
||||
class="line-number">12</span><br><span class="line-number">13</span><br></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="code-group-item" aria-selected="false">
|
||||
<div class="language-json ext-json line-numbers-mode">
|
||||
<pre class="language-json"><code><span class="token punctuation">{</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre>
|
||||
<div class="highlight-lines"><br>
|
||||
<div class="highlight-line"> </div>
|
||||
<div class="highlight-line"> </div><br><br>
|
||||
</div>
|
||||
<div class="line-numbers"><span class="line-number">1</span><br><span
|
||||
class="line-number">2</span><br><span class="line-number">3</span><br>
|
||||
<span class="line-number">4</span><br><span class="line-number">5</span><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>Commands are straight forward. Keep in mind, every other property on the commandModule object is optional
|
||||
except the type and execute function.</p>
|
||||
<h2 id="cclass" tabindex="-1"><a class="header-anchor" href="#cclass" aria-hidden="true">#</a>
|
||||
Context Class</h2>
|
||||
<p>The provided Context class helps with modules of CommandType.Both ( A mixture of slash / legacy commands
|
||||
) In short, Slash Commands, Both Commands, Text Commands carry a Context data structure</p>
|
||||
<br>
|
||||
<p>The Context class is a simple data structure that contains the following properties:</p>
|
||||
<ul>
|
||||
<li>
|
||||
CommandType.Both
|
||||
</li>
|
||||
<li>
|
||||
CommandType.Slash
|
||||
</li>
|
||||
<li>
|
||||
CommandType.Text
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="code-group">
|
||||
<div class="code-group__nav">
|
||||
<ul class="code-group__ul">
|
||||
<li class="code-group__li"><button class="code-group__nav-tab code-group__nav-tab-active"
|
||||
aria-pressed="true" aria-expanded="true">cmd.js</button></li>
|
||||
<li class="code-group__li"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="code-group-item code-group-item__active" aria-selected="true">
|
||||
<div class="language-javascript ext-js line-numbers-mode">
|
||||
<pre class="language-javascript">
|
||||
<code><span class="token keyword">const</span> { CommandType, commandModule } = <span class="token function">require</span>('@sern/handler');
|
||||
|
||||
<span class="token keyword">exports</span>.default = commandModule({
|
||||
name: 'ping',
|
||||
type: CommandType.Both,
|
||||
async execute(ctx) { //ctx is a Context instance
|
||||
await ctx.reply(`pong ${ctx.user}`)
|
||||
// .reply is shared between both message and interaction!
|
||||
// So is an User object!
|
||||
}
|
||||
});
|
||||
</code></pre>
|
||||
<div class="highlight-lines"><br><br><br>
|
||||
<div class="highlight-line"> </div><br>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div><br><br><br><br><br>
|
||||
</div>
|
||||
<div class="line-numbers"><span class="line-number">1</span><br><span
|
||||
class="line-number">2</span><br><span class="line-number">3</span><br><span
|
||||
class="line-number">4</span><br><span class="line-number">5</span><br><span
|
||||
class="line-number">6</span><br><span class="line-number">7</span><br><span
|
||||
class="line-number">8</span><br><span class="line-number">9</span><br><span
|
||||
class="line-number">10</span><br><span class="line-number">11</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="code-group-item" aria-selected="false">
|
||||
<div class="language-json ext-json line-numbers-mode">
|
||||
<pre class="language-json"><code><span class="token punctuation">{</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre>
|
||||
<div class="highlight-lines"><br>
|
||||
<div class="highlight-line"> </div>
|
||||
<div class="highlight-line"> </div><br><br>
|
||||
</div>
|
||||
<div class="line-numbers"><span class="line-number">1</span><br><span
|
||||
class="line-number">2</span><br><span class="line-number">3</span><br>
|
||||
<span class="line-number">4</span><br><span class="line-number">5</span><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<footer class="page-meta">
|
||||
<div class="meta-item edit-link"><a class="nav-link external meta-item-label"
|
||||
href="https://github.com/sern-handler/website/" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="Edit this page">
|
||||
|
||||
Edit this page <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="meta-item last-updated"><span class="meta-item-label">Last Updated at </span>
|
||||
<span class="meta-item-info">18/07/2022, 11:48 PM</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<nav class="page-nav">
|
||||
<p class="inner">
|
||||
<span class="prev">
|
||||
<a href="/guide-en/other/release-notes.html" class="nav-link" aria-label="Relase Notes">
|
||||
← View previous page
|
||||
</a>
|
||||
</span>
|
||||
<span class="next">
|
||||
<a href="/guide-en/walkthroughs/first-event.html" class="nav-link" aria-label="First event">
|
||||
View next page →
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
</nav>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/assets/app.a2fc1d97.js" defer=""></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,374 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script defer>
|
||||
(() => {
|
||||
const { classList } = document.documentElement;
|
||||
const userMode = localStorage.getItem('guide-color-scheme');
|
||||
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||||
classList.toggle('dark', true);
|
||||
}
|
||||
|
||||
const themes = ['blurple'];
|
||||
let colorTheme = localStorage.getItem('guide-color-theme');
|
||||
|
||||
if (colorTheme !== 'default' && !themes.includes(colorTheme)) {
|
||||
colorTheme = 'default';
|
||||
}
|
||||
|
||||
if (colorTheme !== 'default') classList.add(`guide-theme-${colorTheme}`);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="./../../assets/css/gstyle.css">
|
||||
<link rel="icon" href="./../../assets/images/icon.png">
|
||||
<meta name="theme-color" content="#3eaf7c">
|
||||
<meta name="twitter:card" content="summary">
|
||||
|
||||
<meta property="og:title" content="sern Guide">
|
||||
<meta property="og:description" content="sern’s clean, modern and user-friendly guide.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://sern-handler.js.org/guide-en/">
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta name="description" content="sern’s clean, modern and user-friendly user guide.">
|
||||
|
||||
<title>First Event | Guide</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="theme-container">
|
||||
<header class="navbar">
|
||||
<div class="navbar-wrapper">
|
||||
<div class="navbar-links-wrapper">
|
||||
<div class="navbar-links-container"><span class="navbar-links-home">
|
||||
<a aria-current="page" href="/" class="router-link-active router-link-exact-active">
|
||||
<img src="./../../assets/images/icon.png" style="width: 45px; margin-top: 7px;">
|
||||
</a>
|
||||
</span>
|
||||
<nav class="navbar-links can-hide">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Documentation
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://discord.com/invite/QgnfxWzrcj"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Discord Server
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external"
|
||||
href="https://github.com/sern-handler/handler" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="navbar-links-container">
|
||||
<div id="docsearch-container" class="navbar-search"><button type="button"
|
||||
class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg
|
||||
width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
|
||||
stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round"
|
||||
stroke-linejoin="round"></path>
|
||||
</svg><span class="DocSearch-Button-Placeholder">Search the guide</span></span></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="toggle-sidebar-button"><svg viewBox="0 0 448 512" class="icon sidebar-menu-icon">
|
||||
<path fill="currentColor"
|
||||
d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z">
|
||||
</path>
|
||||
</svg><svg viewBox="0 0 24 24" class="icon sidebar-close-icon">
|
||||
<path
|
||||
d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<button class="toggle-dark-button"><svg class="icon light-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z"
|
||||
fill="currentColor"></path>
|
||||
<path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path>
|
||||
<path d="M2 15.005h5v2H2z" fill="currentColor"></path>
|
||||
<path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 25.005h2v5h-2z" fill="currentColor"></path>
|
||||
<path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path>
|
||||
<path d="M25 15.005h5v2h-5z" fill="currentColor"></path>
|
||||
<path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 2.005h2v5h-2z" fill="currentColor"></path>
|
||||
</svg><svg class="icon dark-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path
|
||||
d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<div class="notifications-wrapper">
|
||||
<div class="notifications">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-mask"></div>
|
||||
<div class="sidebar-wrapper">
|
||||
<aside class="sidebar">
|
||||
<nav class="navbar-links">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
|
||||
Documentation <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://github.com/sern-handler/website"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
</nav>
|
||||
<ul class="sidebar-links">
|
||||
<p class="sidebar-heading sidebar-item active">Welcome to sern</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a aria-current="page" href="../intro.html"
|
||||
class="router-link-active router-link-exact-active nav-link sidebar-item active"
|
||||
aria-label="Introduction">
|
||||
Introduction
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../other/release-notes.html" class="nav-link sidebar-item" aria-label="What's new">
|
||||
Release notes
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Walkthroughs</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a href="./cli.html" class="nav-link sidebar-item" aria-label="Initial files">
|
||||
Understanding the CLI
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./first-command.html" class="nav-link sidebar-item" aria-label="Creating commands">
|
||||
Your first command
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./first-event.html" class="nav-link sidebar-item" aria-label="Command handling">
|
||||
Your first event
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Working with plugins
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
SernEmitter
|
||||
<!-- SernEmitter is the name of a class!! -->
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Conclusion
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Good to know</p>
|
||||
<ul class="">
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
sern.config.json
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
<main class="page">
|
||||
<div class="theme-default-content">
|
||||
<h1 id="introduction" tabindex="-1"><a class="header-anchor" href="#notes" aria-hidden="true">#</a>
|
||||
First Event</h1>
|
||||
<p>We will dissect a basic event module.</p>
|
||||
<div class="code-group">
|
||||
<div class="code-group__nav">
|
||||
<ul class="code-group__ul">
|
||||
<li class="code-group__li"><button class="code-group__nav-tab code-group__nav-tab-active"
|
||||
aria-pressed="true" aria-expanded="true">ping.js</button></li>
|
||||
<li class="code-group__li"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="code-group-item code-group-item__active" aria-selected="true">
|
||||
<div class="language-javascript ext-js line-numbers-mode">
|
||||
<pre class="language-javascript">
|
||||
<code><span class="token keyword">const</span> { EventType, eventModule } = <span class="token function">require</span>('@sern/handler');
|
||||
|
||||
<span class="token keyword">exports</span>.default = eventModule({
|
||||
type: EventType.Sern,
|
||||
plugins : [], // NOT SUPPORTED YET
|
||||
name: 'module.activate',
|
||||
execute(event) {
|
||||
console.log(event);
|
||||
}
|
||||
});
|
||||
</code>
|
||||
</pre>
|
||||
<div class="highlight-lines"><br><br><br>
|
||||
<div class="highlight-line"> </div><br>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div>
|
||||
<div class="highlight"> </div><br><br><br><br><br>
|
||||
</div>
|
||||
<div class="line-numbers"><span class="line-number">1</span><br><span
|
||||
class="line-number">2</span><br><span class="line-number">3</span><br><span
|
||||
class="line-number">4</span><br><span class="line-number">5</span><br><span
|
||||
class="line-number">6</span><br><span class="line-number">7</span><br><span
|
||||
class="line-number">8</span><br><span class="line-number">9</span><br><span
|
||||
class="line-number">10</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="code-group-item" aria-selected="false">
|
||||
<div class="language-json ext-json line-numbers-mode">
|
||||
<pre class="language-json"><code><span class="token punctuation">{</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code>
|
||||
</pre>
|
||||
<div class="highlight-lines"><br>
|
||||
<div class="highlight-line"> </div>
|
||||
<div class="highlight-line"> </div><br><br>
|
||||
</div>
|
||||
<div class="line-numbers"><span class="line-number">1</span><br><span
|
||||
class="line-number">2</span><br><span class="line-number">3</span><br>
|
||||
<span class="line-number">4</span><br><span class="line-number">5</span><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>Like command modules, the type property denotes what kind of event it is, which can be found <a
|
||||
href="/docs">here.</a> <br> To view what each of these properties mean in depth, visit the official <a
|
||||
href="/docs">documentation.</a></p>
|
||||
|
||||
<p>Event modules are laid out similarly to command modules. These listen to any and all event you provide.
|
||||
In the current version 1.1.7-beta, plugins are not supported.</p>
|
||||
<footer class="page-meta">
|
||||
<div class="meta-item edit-link"><a class="nav-link external meta-item-label"
|
||||
href="https://github.com/sern-handler/website/" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="Edit this page">
|
||||
|
||||
Edit this page <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="meta-item last-updated"><span class="meta-item-label">Last Updated at </span>
|
||||
<span class="meta-item-info">18/07/2022, 11:48 PM</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<nav class="page-nav">
|
||||
<p class="inner">
|
||||
<span class="prev">
|
||||
<a href="/guide-en/other/release-notes.html" class="nav-link" aria-label="Relase Notes">
|
||||
← View previous page
|
||||
</a>
|
||||
</span>
|
||||
<span class="next">
|
||||
<a href="/guide-en/walkthroughs/plugins.html" class="nav-link" aria-label="First event">
|
||||
View next page →
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
</nav>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/assets/app.a2fc1d97.js" defer=""></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,318 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script defer>
|
||||
(() => {
|
||||
const { classList } = document.documentElement;
|
||||
const userMode = localStorage.getItem('guide-color-scheme');
|
||||
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||||
classList.toggle('dark', true);
|
||||
}
|
||||
|
||||
const themes = ['blurple'];
|
||||
let colorTheme = localStorage.getItem('guide-color-theme');
|
||||
|
||||
if (colorTheme !== 'default' && !themes.includes(colorTheme)) {
|
||||
colorTheme = 'default';
|
||||
}
|
||||
|
||||
if (colorTheme !== 'default') classList.add(`guide-theme-${colorTheme}`);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="./../../assets/css/gstyle.css">
|
||||
<link rel="icon" href="./../../assets/images/icon.png">
|
||||
<meta name="theme-color" content="#3eaf7c">
|
||||
<meta name="twitter:card" content="summary">
|
||||
|
||||
<meta property="og:title" content="sern Guide">
|
||||
<meta property="og:description" content="sern’s clean, modern and user-friendly guide.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://sern-handler.js.org/guide-en/">
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta name="description" content="sern’s clean, modern and user-friendly user guide.">
|
||||
|
||||
<title>Plugins | Guide</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="theme-container">
|
||||
<header class="navbar">
|
||||
<div class="navbar-wrapper">
|
||||
<div class="navbar-links-wrapper">
|
||||
<div class="navbar-links-container"><span class="navbar-links-home">
|
||||
<a aria-current="page" href="/" class="router-link-active router-link-exact-active">
|
||||
<img src="./../../assets/images/icon.png" style="width: 45px; margin-top: 7px;">
|
||||
</a>
|
||||
</span>
|
||||
<nav class="navbar-links can-hide">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Documentation
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://discord.com/invite/QgnfxWzrcj"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
Discord Server
|
||||
<span>
|
||||
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false"
|
||||
x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-links-item"><a class="nav-link external"
|
||||
href="https://github.com/sern-handler/handler" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="navbar-links-container">
|
||||
<div id="docsearch-container" class="navbar-search"><button type="button"
|
||||
class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg
|
||||
width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z"
|
||||
stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round"
|
||||
stroke-linejoin="round"></path>
|
||||
</svg><span class="DocSearch-Button-Placeholder">Search the guide</span></span></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="toggle-sidebar-button"><svg viewBox="0 0 448 512" class="icon sidebar-menu-icon">
|
||||
<path fill="currentColor"
|
||||
d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z">
|
||||
</path>
|
||||
</svg><svg viewBox="0 0 24 24" class="icon sidebar-close-icon">
|
||||
<path
|
||||
d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<button class="toggle-dark-button"><svg class="icon light-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z"
|
||||
fill="currentColor"></path>
|
||||
<path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path>
|
||||
<path d="M2 15.005h5v2H2z" fill="currentColor"></path>
|
||||
<path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 25.005h2v5h-2z" fill="currentColor"></path>
|
||||
<path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path>
|
||||
<path d="M25 15.005h5v2h-5z" fill="currentColor"></path>
|
||||
<path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path>
|
||||
<path d="M15 2.005h2v5h-2z" fill="currentColor"></path>
|
||||
</svg><svg class="icon dark-icon" focusable="false" viewBox="0 0 32 32">
|
||||
<path
|
||||
d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z"
|
||||
fill="currentColor"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<div class="notifications-wrapper">
|
||||
<div class="notifications">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar-mask"></div>
|
||||
<div class="sidebar-wrapper">
|
||||
<aside class="sidebar">
|
||||
<nav class="navbar-links">
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://sern-handler.js.org/docs"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="Documentation">
|
||||
|
||||
Documentation <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="navbar-links-item"><a class="nav-link external" href="https://github.com/sern-handler/website"
|
||||
rel="noopener noreferrer" target="_blank" aria-label="GitHub">
|
||||
|
||||
GitHub <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
</nav>
|
||||
<ul class="sidebar-links">
|
||||
<p class="sidebar-heading sidebar-item active">Welcome to sern</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a aria-current="page" href="../intro.html"
|
||||
class="router-link-active router-link-exact-active nav-link sidebar-item active"
|
||||
aria-label="Introduction">
|
||||
Introduction
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../other/release-notes.html" class="nav-link sidebar-item" aria-label="What's new">
|
||||
Release notes
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Walkthroughs</p>
|
||||
<ul class="">
|
||||
<li>
|
||||
<a href="./cli.html" class="nav-link sidebar-item" aria-label="Initial files">
|
||||
Understanding the CLI
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./first-command.html" class="nav-link sidebar-item" aria-label="Creating commands">
|
||||
Your first command
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./first-event.html" class="nav-link sidebar-item" aria-label="Command handling">
|
||||
Your first event
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Working with plugins
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
SernEmitter
|
||||
<!-- SernEmitter is the name of a class!! -->
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
Conclusion
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="sidebar-heading sidebar-item">Good to know</p>
|
||||
<ul class="">
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
sern.config.json
|
||||
</a>
|
||||
</li>
|
||||
<a href="./creating-your-bot/event-handling.html" class="nav-link sidebar-item"
|
||||
aria-label="Event handling">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
<main class="page">
|
||||
<div class="theme-default-content">
|
||||
<h1 id="introduction" tabindex="-1"><a class="header-anchor" href="#notes" aria-hidden="true">#</a>
|
||||
Working with plugins</h1>
|
||||
<p>As of now, modules seem a little underwhelming.
|
||||
It appears that sern doesn't have all the features of a standard handler, which manages permissions,
|
||||
categorizes, cool-downs, publishes application commands, role permissions, etc.
|
||||
Many important parts that manage access and help streamline command creation to make are apparently
|
||||
absent.
|
||||
<!-- Below is an example of an event plugin, one of the types of plugins. -->
|
||||
</p>
|
||||
|
||||
<footer class="page-meta">
|
||||
<div class="meta-item edit-link"><a class="nav-link external meta-item-label"
|
||||
href="https://github.com/sern-handler/website/" rel="noopener noreferrer" target="_blank"
|
||||
aria-label="Edit this page">
|
||||
|
||||
Edit this page <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true"
|
||||
focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
|
||||
<path fill="currentColor"
|
||||
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
|
||||
</path>
|
||||
<polygon fill="currentColor"
|
||||
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
|
||||
</polygon>
|
||||
</svg>
|
||||
<span class="sr-only">open in new window</span>
|
||||
</span>
|
||||
</a></div>
|
||||
<div class="meta-item last-updated"><span class="meta-item-label">Last Updated at </span>
|
||||
<span class="meta-item-info">18/07/2022, 11:48 PM</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<nav class="page-nav">
|
||||
<p class="inner">
|
||||
<span class="prev">
|
||||
<a href="/guide-en/walkthroughs/first-event.html" class="nav-link" aria-label="Relase Notes">
|
||||
← View previous page
|
||||
</a>
|
||||
</span>
|
||||
<span class="next">
|
||||
<a href="/guide-en/walkthroughs/conclusion.html" class="nav-link" aria-label="First event">
|
||||
View next page →
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
</nav>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/assets/app.a2fc1d97.js" defer=""></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,10 +0,0 @@
|
||||
Tell the users how to prepare to code.
|
||||
like installing node & npm & etc.
|
||||
|
||||
(this is for the user who never coded before)
|
||||
|
||||
# Preparing to Code
|
||||
|
||||
After installing and IDE you need to insall node.
|
||||
|
||||
You can download the LTS version of node right [here](https://nodejs.org/en/download/release/latest/)
|
||||
@@ -1 +0,0 @@
|
||||
😈 Kill sapphire
|
||||
@@ -1,9 +0,0 @@
|
||||
# Choosing an IDE
|
||||
|
||||
Choosing an IDE is a matter of personal preference. The following are some
|
||||
suggestions for choosing an IDE:
|
||||
|
||||
* [Visual Studio Code](https://code.visualstudio.com)
|
||||
* [Sublime Text](https://www.sublimetext.com/)
|
||||
* [NotePad++](https://notepad-plus-plus.org/)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
Tell the users how to prepare to code.
|
||||
like installing node & npm & etc.
|
||||
|
||||
(this is for the user who never coded before)
|
||||
|
||||
# Preparing to Code
|
||||
|
||||
After installing and IDE you need to insall node.
|
||||
|
||||
You can download the LTS version of node right [here](https://nodejs.org/en/download/release/latest/)
|
||||
@@ -1 +0,0 @@
|
||||
😈 Kill sapphire
|
||||
@@ -1,17 +0,0 @@
|
||||
# Giriş
|
||||
|
||||
Sern'ün resmi kılavuzuna hoşgeldiniz. Bu kılavuz size Sern'ü anlamanızda ve kullanmanızda yardımcı olacak.
|
||||
|
||||
### Ne öğreneceğim?
|
||||
|
||||
* Discord.js v14 basit bir bot yapmayı,
|
||||
* Sern'ü komut satır arayüzü (CLI) ile kullanmayı,
|
||||
* Sern'ün kullanımının kolaylıklarını,
|
||||
|
||||
### Ek Başlıklar
|
||||
|
||||
* Biz kimiz?
|
||||
* Proje Hakkında
|
||||
* Sern vs Sapphire
|
||||
|
||||
Eğer hazırsan başlayalım 🥳🥰
|
||||
@@ -1,9 +0,0 @@
|
||||
# Choosing an IDE
|
||||
|
||||
Choosing an IDE is a matter of personal preference. The following are some
|
||||
suggestions for choosing an IDE:
|
||||
|
||||
* [Visual Studio Code](https://code.visualstudio.com)
|
||||
* [Sublime Text](https://www.sublimetext.com/)
|
||||
* [NotePad++](https://notepad-plus-plus.org/)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
Tell the users how to prepare to code.
|
||||
like installing node & npm & etc.
|
||||
|
||||
(this is for the user who never coded before)
|
||||
|
||||
# Preparing to Code
|
||||
|
||||
After installing and IDE you need to insall node.
|
||||
|
||||
You can download the LTS version of node right [here](https://nodejs.org/en/download/release/latest/)
|
||||
@@ -1 +0,0 @@
|
||||
😈 Kill sapphire
|
||||
@@ -1,3 +1,3 @@
|
||||
[build]
|
||||
publish = "/"
|
||||
command = "npm run build"
|
||||
publish = "/build"
|
||||
command = "npm run build"
|
||||
22659
package-lock.json
generated
Normal file
22659
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@@ -1,11 +1,53 @@
|
||||
{
|
||||
"name": "@sern/website",
|
||||
"version": "1.0.0",
|
||||
"description": "Sern's modern, clean and beginner friendly web interface",
|
||||
"private": true,
|
||||
"description": "Our modern, clean and beginner friendly web interface",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "exit 0"
|
||||
"docusaurus": "docusaurus",
|
||||
"start": "docusaurus start",
|
||||
"build": "docusaurus build",
|
||||
"swizzle": "docusaurus swizzle",
|
||||
"deploy": "docusaurus deploy",
|
||||
"clear": "docusaurus clear",
|
||||
"serve": "docusaurus serve",
|
||||
"write-translations": "docusaurus write-translations",
|
||||
"write-heading-ids": "docusaurus write-heading-ids",
|
||||
"typedoc-json": "typedoc --json ../sern-community/docs.json --pretty --entryPoints ../sernHandlerV2/src/index.ts --tsconfig ../sernHandlerV2/tsconfig-esm.json --excludeExternals"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-rc.1",
|
||||
"@docusaurus/plugin-content-pages": "^2.0.1",
|
||||
"@docusaurus/preset-classic": "2.0.0-rc.1",
|
||||
"@docusaurus/theme-search-algolia": "^2.0.0-rc.1",
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"clsx": "^1.2.1",
|
||||
"jsdoc-parse-plus": "^1.3.0",
|
||||
"prism-react-renderer": "^1.3.5",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-rc.1",
|
||||
"docusaurus-plugin-typedoc": "^0.17.5",
|
||||
"typedoc": "^0.23.8",
|
||||
"typedoc-plugin-markdown": "^3.13.4"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.5%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.14"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
31
sidebars.js
Normal file
31
sidebars.js
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Creating a sidebar enables you to:
|
||||
- create an ordered group of docs
|
||||
- render a sidebar for each doc of that group
|
||||
- provide next/previous navigation
|
||||
|
||||
The sidebars can be generated from the filesystem, or explicitly defined here.
|
||||
|
||||
Create as many sidebars as you want.
|
||||
*/
|
||||
|
||||
// @ts-check
|
||||
|
||||
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
|
||||
const sidebars = {
|
||||
// By default, Docusaurus generates a sidebar from the docs folder structure
|
||||
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
|
||||
|
||||
// But you can create a sidebar manually
|
||||
/*
|
||||
tutorialSidebar: [
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Tutorial',
|
||||
items: ['hello'],
|
||||
},
|
||||
],
|
||||
*/
|
||||
};
|
||||
|
||||
module.exports = sidebars;
|
||||
65
src/components/HomepageFeatures/index.js
Normal file
65
src/components/HomepageFeatures/index.js
Normal file
@@ -0,0 +1,65 @@
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
const FeatureList = [
|
||||
{
|
||||
title: 'Batteries included',
|
||||
Svg: require('@site/static/img/battery-svgrepo-com.svg').default,
|
||||
description: (
|
||||
<>
|
||||
Start or integrate a new project in minutes.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Customizable',
|
||||
Svg: require('@site/static/img/puzzle-svgrepo-com.svg').default,
|
||||
description: (
|
||||
<>
|
||||
Extend or customize with community-based plugins to provide utilities, filters, and more.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Modern',
|
||||
Svg: require('@site/static/img/typescript-svgrepo-com.svg').default,
|
||||
description: (
|
||||
<>
|
||||
Uses modern and powerful tooling such as
|
||||
<a href={'https://swc.rs/'}> swc</a>,
|
||||
<a href={'https://tsup.egoist.dev/'}> tsup</a>,
|
||||
<a href={'https://www.typescriptlang.org/'}> typescript</a>, and
|
||||
<a href={'https://rxjs.dev/'}> rxjs</a> to future-proof and ensure project quality.
|
||||
</>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
function Feature({Svg, title, description}) {
|
||||
return (
|
||||
<div className={clsx('col col--4')}>
|
||||
<div className="text--center">
|
||||
<Svg className={styles.featureSvg} role="img" />
|
||||
</div>
|
||||
<div className="text--center padding-horiz--md">
|
||||
<h3>{title}</h3>
|
||||
<p>{description}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function HomepageFeatures() {
|
||||
return (
|
||||
<section className={styles.features}>
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
{FeatureList.map((props, idx) => (
|
||||
<Feature key={idx} {...props} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
11
src/components/HomepageFeatures/styles.module.css
Normal file
11
src/components/HomepageFeatures/styles.module.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.features {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 2rem 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.featureSvg {
|
||||
height: 200px;
|
||||
width: 200px;
|
||||
}
|
||||
43
src/css/custom.css
Normal file
43
src/css/custom.css
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Any CSS included here will be global. The classic template
|
||||
* bundles Infima by default. Infima is a CSS framework designed to
|
||||
* work well for content-centric websites.
|
||||
*/
|
||||
|
||||
/* You can override the default Infima variables here. */
|
||||
:root {
|
||||
--ifm-color-primary: #3d2d5e;
|
||||
--ifm-color-primary-dark: #372955;
|
||||
--ifm-color-primary-darker: #342650;
|
||||
--ifm-color-primary-darkest: #2b2042;
|
||||
--ifm-color-primary-light: #433267;
|
||||
--ifm-color-primary-lighter: #46346c;
|
||||
--ifm-color-primary-lightest: #3a2b59;
|
||||
--ifm-background-color: #e7e6e8;
|
||||
--ifm-code-font-size: 95%;
|
||||
--docusaurus-highlighted-code-line-bg: rgba(82, 78, 183, 0.2);
|
||||
--ifm-font-family-monospace: 'Fira Code', 'Meslo NGF', 'JetBrains Mono', 'Menlo', SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
|
||||
'Courier New', monospace;
|
||||
--ifm-font-family-base: Mulish, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
||||
--ifm-navbar-background-color : #ca7693
|
||||
}
|
||||
|
||||
.footer--dark {
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
||||
[data-theme='dark'] {
|
||||
--ifm-color-primary: #f7dbf2;
|
||||
--ifm-color-primary-dark: #efb5e4;
|
||||
--ifm-color-primary-darker: #eaa2dd;
|
||||
--ifm-color-primary-darkest: #de69c9;
|
||||
--ifm-color-primary-light: #ffffff;
|
||||
--ifm-color-primary-lighter: #ffffff;
|
||||
--ifm-color-primary-lightest: #ffffff;
|
||||
--docusaurus-highlighted-code-line-bg: rgba(82, 78, 183, 0.3);
|
||||
--ifm-font-family-monospace: 'Fira Code', 'Meslo NGF', 'JetBrains Mono', 'Menlo', SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
|
||||
'Courier New', monospace;
|
||||
--ifm-navbar-background-color : #ca7693
|
||||
}
|
||||
58
src/pages/index.js
Normal file
58
src/pages/index.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import Link from '@docusaurus/Link';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import Layout from '@theme/Layout';
|
||||
import HomepageFeatures from '@site/src/components/HomepageFeatures';
|
||||
import logo from '@site/static/img/sern-logo.png'
|
||||
import styles from './index.module.css';
|
||||
|
||||
function HomepageHeader() {
|
||||
const { siteConfig } = useDocusaurusContext();
|
||||
return (
|
||||
<header className={clsx('hero hero--primary-darker', styles.heroBanner)}>
|
||||
<div className="container">
|
||||
<div className='container'>
|
||||
<div className="row">
|
||||
<div className={ "col col--6 " }>
|
||||
<h1
|
||||
className={clsx("hero__title", styles['padding-vert--md'])}
|
||||
style={ { fontSize : '450%' }}
|
||||
>
|
||||
<b>{siteConfig.title.slice(6)}</b>
|
||||
</h1>
|
||||
<p className="hero__subtitle">{siteConfig.tagline}</p>
|
||||
<Link
|
||||
className="button button--secondary button--lg"
|
||||
to="https://sern-handler.js.org/guide/walkthrough/cli">
|
||||
sern init
|
||||
</Link>
|
||||
</div>
|
||||
<div className="col col--6">
|
||||
<img src={logo} alt="logo" height={'100%'}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.buttons}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Home() {
|
||||
const { siteConfig } = useDocusaurusContext();
|
||||
return (
|
||||
<Layout
|
||||
title={siteConfig.title}
|
||||
description="Description will go into a meta tag in"
|
||||
>
|
||||
<HomepageHeader/>
|
||||
<main className='user-select-none'>
|
||||
<div className='hero'>
|
||||
<HomepageFeatures/>
|
||||
</div>
|
||||
</main>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
35
src/pages/index.module.css
Normal file
35
src/pages/index.module.css
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* CSS files with the .module.css suffix will be treated as CSS modules
|
||||
* and scoped locally.
|
||||
*/
|
||||
|
||||
.heroBanner {
|
||||
padding: 4rem 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 996px) {
|
||||
.heroBanner {
|
||||
padding: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.padding-vert--md {
|
||||
padding-top: 10.10rem;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1200px) {
|
||||
.padding-vert--md {
|
||||
padding-top: 5rem;
|
||||
}
|
||||
}
|
||||
7
src/pages/markdown-page.md
Normal file
7
src/pages/markdown-page.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: Markdown page example
|
||||
---
|
||||
|
||||
# Markdown page example
|
||||
|
||||
You don't need React to write simple standalone pages.
|
||||
18
src/pages/plugins.js
Normal file
18
src/pages/plugins.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import Layout from '@theme/Layout';
|
||||
import clsx from "clsx";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
export default function Plugins() {
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<header className={clsx('hero hero--primary-darker', styles.heroBanner)}>
|
||||
<h1 className={"hero__title"}>
|
||||
Coming soon
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
32
src/theme/CodeBlock/index.js
Normal file
32
src/theme/CodeBlock/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import React, {isValidElement} from 'react';
|
||||
import useIsBrowser from '@docusaurus/useIsBrowser';
|
||||
import ElementContent from '@theme/CodeBlock/Content/Element';
|
||||
import StringContent from '@theme/CodeBlock/Content/String';
|
||||
/**
|
||||
* Best attempt to make the children a plain string so it is copyable. If there
|
||||
* are react elements, we will not be able to copy the content, and it will
|
||||
* return `children` as-is; otherwise, it concatenates the string children
|
||||
* together.
|
||||
*/
|
||||
function maybeStringifyChildren(children) {
|
||||
if (React.Children.toArray(children).some((el) => isValidElement(el))) {
|
||||
return children;
|
||||
}
|
||||
// The children is now guaranteed to be one/more plain strings
|
||||
return Array.isArray(children) ? children.join('') : children;
|
||||
}
|
||||
export default function CodeBlock({children: rawChildren, ...props}) {
|
||||
// The Prism theme on SSR is always the default theme but the site theme can
|
||||
// be in a different mode. React hydration doesn't update DOM styles that come
|
||||
// from SSR. Hence force a re-render after mounting to apply the current
|
||||
// relevant styles.
|
||||
const isBrowser = useIsBrowser();
|
||||
const children = maybeStringifyChildren(rawChildren);
|
||||
const CodeBlockComp =
|
||||
typeof children === 'string' ? StringContent : ElementContent;
|
||||
return (
|
||||
<CodeBlockComp key={String(isBrowser)} {...props}>
|
||||
{children}
|
||||
</CodeBlockComp>
|
||||
);
|
||||
}
|
||||
51
static/img/battery-svgrepo-com.svg
Normal file
51
static/img/battery-svgrepo-com.svg
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
||||
<g>
|
||||
<polygon style="fill:#34485C;" points="17.655,441.379 494.345,441.379 494.345,123.586 17.655,123.586 "/>
|
||||
<polygon style="fill:#4897F7;" points="70.621,88.276 123.586,88.276 123.586,35.31 70.621,35.31 "/>
|
||||
<polygon style="fill:#576D7E;" points="61.793,238.345 167.724,238.345 167.724,203.034 61.793,203.034 "/>
|
||||
<polygon style="fill:#397ABC;" points="150.073,123.586 44.142,123.586 61.798,88.276 132.418,88.276 "/>
|
||||
<polygon style="fill:#C6421E;" points="388.414,88.276 441.379,88.276 441.379,35.31 388.414,35.31 "/>
|
||||
<polygon style="fill:#992C13;" points="467.866,123.586 361.935,123.586 379.591,88.276 450.211,88.276 "/>
|
||||
<g>
|
||||
<polygon style="fill:#576D7E;" points="450.211,203.034 414.901,203.034 414.901,167.724 379.591,167.724 379.591,203.034
|
||||
344.28,203.034 344.28,238.345 379.591,238.345 379.591,273.655 414.901,273.655 414.901,238.345 450.211,238.345 "/>
|
||||
<polygon style="fill:#576D7E;" points="0,476.69 512,476.69 512,441.379 0,441.379 "/>
|
||||
<path style="fill:#576D7E;" d="M176.556,44.138v79.448h35.31V79.475c0-4.89,3.964-8.854,8.854-8.854h70.568
|
||||
c4.89,0,8.854,3.964,8.854,8.854v44.111h35.31V44.138c0-4.873-3.955-8.828-8.828-8.828H185.384
|
||||
C180.511,35.31,176.556,39.265,176.556,44.138"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
BIN
static/img/favicon.ico
Normal file
BIN
static/img/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
1
static/img/logo.svg
Normal file
1
static/img/logo.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 6.3 KiB |
50
static/img/puzzle-svgrepo-com.svg
Normal file
50
static/img/puzzle-svgrepo-com.svg
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 58 58" style="enable-background:new 0 0 58 58;" xml:space="preserve">
|
||||
<g>
|
||||
<path style="fill:#E57E25;" d="M25,37.376c1.539,0,2.938,0.584,4,1.537v-7.298c0-1.789-1.45-3.239-3.239-3.239h-7.448
|
||||
c1.618-1.075,2.686-2.912,2.686-5c0-3.314-2.686-6-6-6s-6,2.686-6,6c0,2.088,1.068,3.925,2.686,5H3.239
|
||||
C1.45,28.376,0,29.826,0,31.615v8.447c1.075-1.618,2.912-2.686,5-2.686c3.314,0,6,2.686,6,6s-2.686,6-6,6
|
||||
c-2.088,0-3.925-1.068-5-2.686v7.447c0,1.789,1.45,3.239,3.239,3.239h22.523c1.789,0,3.239-1.45,3.239-3.239V47.84
|
||||
c-1.062,0.952-2.461,1.537-4,1.537c-3.314,0-6-2.686-6-6S21.686,37.376,25,37.376z"/>
|
||||
<path style="fill:#F0C419;" d="M26.832,14.761c1.666,0.489,3.382,0.068,4.619-0.971c-0.104,0.353-0.196,0.668-0.269,0.917
|
||||
l-1.71,5.824c-0.419,1.427,0.398,2.924,1.825,3.343l5.943,1.745c-1.543,0.478-2.826,1.694-3.315,3.36
|
||||
c-0.777,2.644,0.737,5.417,3.381,6.194c2.644,0.777,5.417-0.737,6.194-3.381c0.489-1.666,0.068-3.382-0.971-4.619l6.741,1.98
|
||||
c1.427,0.419,2.924-0.398,3.343-1.825l1.98-6.741c-1.237,1.039-2.953,1.461-4.619,0.971c-2.644-0.777-4.158-3.55-3.381-6.194
|
||||
s3.55-4.158,6.194-3.381c1.666,0.489,2.882,1.772,3.36,3.315l1.745-5.943c0.419-1.427-0.398-2.924-1.825-3.343L38.093,0.733
|
||||
c-1.427-0.419-2.924,0.398-3.343,1.825l-1.476,5.026c-0.08,0.271-0.171,0.583-0.269,0.917c-0.478-1.543-1.694-2.826-3.36-3.315
|
||||
C27,4.409,24.227,5.923,23.451,8.567S24.188,13.985,26.832,14.761z"/>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
BIN
static/img/sern-logo.png
Normal file
BIN
static/img/sern-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
7
static/img/typescript-svgrepo-com.svg
Normal file
7
static/img/typescript-svgrepo-com.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
aria-label="TypeScript" role="img"
|
||||
viewBox="0 0 512 512"><rect
|
||||
width="512" height="512"
|
||||
rx="15%"
|
||||
fill="#3178c6"/><path fill="#fff"
|
||||
d="m233 284h64v-41H118v41h64v183h51zm84 173c8.1 4.2 18 7.3 29 9.4s23 3.1 35 3.1c12 0 23-1.1 34-3.4c11-2.3 20-6.1 28-11c8.1-5.3 15-12 19-21s7.1-19 7.1-32c0-9.1-1.4-17-4.1-24s-6.6-13-12-18c-5.1-5.3-11-10-18-14s-15-8.2-24-12c-6.6-2.7-12-5.3-18-7.9c-5.2-2.6-9.7-5.2-13-7.8c-3.7-2.7-6.5-5.5-8.5-8.4c-2-3-3-6.3-3-10c0-3.4.89-6.5 2.7-9.3s4.3-5.1 7.5-7.1c3.2-2 7.2-3.5 12-4.6c4.7-1.1 9.9-1.6 16-1.6c4.2 0 8.6.31 13 .94c4.6.63 9.3 1.6 14 2.9c4.7 1.3 9.3 2.9 14 4.9c4.4 2 8.5 4.3 12 6.9v-47c-7.6-2.9-16-5.1-25-6.5s-19-2.1-31-2.1c-12 0-23 1.3-34 3.8s-20 6.5-28 12c-8.1 5.4-14 12-19 21c-4.7 8.4-7 18-7 30c0 15 4.3 28 13 38c8.6 11 22 19 39 27c6.9 2.8 13 5.6 19 8.3s11 5.5 15 8.4c4.3 2.9 7.7 6.1 10 9.5c2.5 3.4 3.8 7.4 3.8 12c0 3.2-.78 6.2-2.3 9s-3.9 5.2-7.1 7.2s-7.1 3.6-12 4.8c-4.7 1.1-10 1.7-17 1.7c-11 0-22-1.9-32-5.7c-11-3.8-21-9.5-28.1-15.44z"/></svg>
|
||||
|
After Width: | Height: | Size: 1014 B |
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>sern - Handlers. Redefined.</title>
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
<meta name="og:url" content="https://github.com/sern-handler/handler">
|
||||
<meta name="og:type" content="website">
|
||||
|
||||
<script src="assets/js/main.js"></script>
|
||||
</head>
|
||||
<body class="user-select-none">
|
||||
<nav class="navbar navbar-expand-lg py-1.25 navbar-light bg-light shadow-rm">
|
||||
<div class="container">
|
||||
<a href="#" class="navbar-brand">
|
||||
<img src="assets/images/logo.png" width="42" height="40" alt="" class="d-inline-block align-middle mr-2">
|
||||
<span class="text font-weight-bold font-family-ubuntu hover-zoom">SernHandlerㅤ</span>
|
||||
<span>7 <i class="bi bi-star-fill padding-7px"></i>・270 <i class="bi bi-arrow-bar-down"></i></span>
|
||||
<span class="text font-weight-bold font-family-ubuntu hover-zoom">SernHandler</span>
|
||||
<span>7 <i class="bi bi-star-fill padding-7px"></i>270 <i class="bi bi-arrow-bar-down"></i></span>
|
||||
</a>
|
||||
|
||||
<button type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler"><span class="navbar-toggler-icon"></span></button>
|
||||
@@ -49,7 +48,7 @@
|
||||
<h1 class="display-1 lh-1 mb-3 fw-bold text-bold">Handlers. Redefined.</h1>
|
||||
<p class="lead fw-normal text-muted mb-5 text-align-left">With the support of community-made plugins and powerful CLI, it's more than just a handler.</p>
|
||||
<div class="d-flex flex-column flex-lg-row align-items-center">
|
||||
<img class="app-badge" src="assets/images/R.png" alt="..." /><p class="fw-bold font-family-ubuntu text ml-2 mt-3 qi">• npm install @sern/handler</p>
|
||||
<img class="app-badge" src="assets/images/R.png" alt="..." /><p class="fw-bold font-family-ubuntu text ml-2 mt-3 qi">npm install @sern/handler</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,7 +57,7 @@
|
||||
<div class="device-wrapper">
|
||||
<div class="device" data-device="iPhoneX" data-orientation="portrait" data-color="black">
|
||||
<div class="screen">
|
||||
<img src="assets/images/logo.png" class="hero-img" height="120%">
|
||||
<img src="assets/images/logo.png" class="hero-img" height="120%" alt="logo">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user