Skip to content

Commit

Permalink
more config
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoobes committed Jul 18, 2024
1 parent 0ac2b02 commit 15d6008
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/content/docs/v4/reference/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,36 @@ Sern.init(config)
```

## Optional

### events
Supply a directory for sern to register [event modules](/v4/reference/modules)
```js
export const events = "./dist/events"
```

### tasks
Supply a directory for sern to register [scheduled tasks](/v4/reference/tasks)
```js
export const tasks = "./dist/tasks"
```

### defaultPrefix
Supply a prefix for sern to enable text commands.

```js
export const defaultPrefix = "?"
```

### user defined
Feel free to supply any other constants / variables you may need.
```js
export const OWNERS = ['182326315813306368']
```


:::warning
If you use javascript + common.js, star imports do not work. Please export an object default and put your configuration there.
```js
exports.default = {
commands : "./dist/commands",
}
```
:::
5 changes: 5 additions & 0 deletions src/content/docs/v4/reference/modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ We are now moving to event modules, which listens to the vast streams of data pr
- `discord.js`, `EventType.Discord`
- `yourself`, `EventType.External`

If you haven't already, add the `events` directory to your [config](/v4/reference/config)
```js
export const events="./dist/tasks";
```
<FileTree>
- src/events/
Expand Down

0 comments on commit 15d6008

Please sign in to comment.