mirror of
https://github.com/sern-handler/website
synced 2026-06-06 01:16:47 +00:00
change walkthrough name and update walkthrough
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
---
|
||||
sidebar_position: 7
|
||||
---
|
||||
|
||||
:::warning
|
||||
This is version 2 code. Please view [transitioning to v3](../transition)
|
||||
:::
|
||||
Since version 2.0.0, dependency injection, thanks to [iti](https://github.com/molszanski/iti), is a feature to customize your bot's utilities and structures.
|
||||
|
||||
Minimal setup for any project.
|
||||
@@ -2,9 +2,9 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
::warning
|
||||
This is the v2 guide. Go to the v3 guide!
|
||||
::
|
||||
:::warning
|
||||
Please read the transition page if you are moving from version 2 to version 3.
|
||||
:::
|
||||
|
||||
# Walkthrough
|
||||
|
||||
@@ -11,4 +11,4 @@ You're shipped with the SernEmitter. This EventEmitter listens to
|
||||
- `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.dev/docs/api/modules#serneventsmapping">events</a>
|
||||
<br/>View all <a href="https://sern.dev/docs/api/modules#serneventsmapping">events</a>
|
||||
@@ -2,9 +2,11 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Transitioning from v2 to v3
|
||||
|
||||
# transition from v2 to v3
|
||||
|
||||
:::warning
|
||||
The "Node" moduleResolution is the only one that has been tested to work with sern.
|
||||
:::
|
||||
- Sern.makeDependencies -> makeDependencies
|
||||
- it is asynchronous and top level function now. Make sure to await it before initing for proper synchronization.
|
||||
|
||||
@@ -14,8 +16,7 @@ sidebar_position: 1
|
||||
+ await makeDependencies({ build: () => {} })
|
||||
```
|
||||
Also, v3 comes with the new Service api. To make sure to enable intellisense
|
||||
|
||||
include a dependencies.d.ts file into compilation.
|
||||
include a dependencies.d.ts file into compilation. [Click here for all new features](../../../blog/3.0.0)
|
||||
```ts
|
||||
/**
|
||||
* This file serves as intellisense for sern projects.
|
||||
@@ -32,7 +33,22 @@ declare global {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export {}
|
||||
|
||||
```
|
||||
|
||||
A standard project file tree: <br />
|
||||
|
||||

|
||||
|
||||
|
||||
:::tip
|
||||
Usually, you would use the create-bot tool.
|
||||
For brand new bots, run
|
||||
|
||||
```sh
|
||||
npm create @sern/bot
|
||||
```
|
||||
|
||||
and follow the interactive prompts.
|
||||
:::tip
|
||||
BIN
static/img/fs.png
Normal file
BIN
static/img/fs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
Reference in New Issue
Block a user