Skip to content
sern

Config

Your app needs a way to store constants and required variables for the framework to work.

A project should look like this:

  • Directorysrc
    • Directorycommands/
    • Directoryevents/
    • Directoryplugins/
    • index.js
    • config.js we are here
  • .env
  • .gitignore
  • bun.lockb
  • package.json
  • README.md
  • sern.config.json
  • jsconfig.json # tsconfig.json if you are using typescript

Required

commands

src/config.js
1
export const commands = './dist/commands'

We will pass this file so sern can start properly.

src/index.js
1
import * as config from './config.js'
2
3
Sern.init(config)

Optional

events

Supply a directory for sern to register event modules

1
export const events = "./dist/events"

tasks

Supply a directory for sern to register scheduled tasks

1
export const tasks = "./dist/tasks"

defaultPrefix

Supply a prefix for sern to enable text commands.

1
export const defaultPrefix = "?"

user defined

Feel free to supply any other constants / variables you may need.

1
export const OWNERS = ['182326315813306368']