NECos is a Discord bot & REST API developed for the Nuclear Engineering Co. (See links below).
NECos Releases
Nuclear Engineering Co.
NECo Discord
NECos has a built-in CLI utility, via the necos
script in the root project directory. Run ./necos usage
to get a list of commands.
You can also run the application manually by requiring the NECos.ts
file.
NECos is written in TypeScript, but it also ships with ts-node as a dependency so you're good there.
However, NECos requires npx, if starting the bot via CLI.
- Clone the NECos repository to whatever directory you'd like.
- Run
npm install
, oryarn install
. PNPM has NOT been tested. - Copy the
config.example
directory toconfig
. The application will NOT start without valid configuration. Seeconfiguration
below. - Initialize the database by running
NODE_OPTIONS="--loader ts-node/esm" knex migrate:latest --knexfile config/dbconfig.ts
- You're done!
NECos requires a working database backend. The application uses Knex as a database backend. The database can be configured in config/dbconfig.js
. By default you have two "environments", development and production. The environment used is dependent on the NODE_ENV environment variable.
This is to ensure testing and production data are separate, as not to accidentally corrupt anything from update to update.
In config/application.toml
, you have three different configuration sections, app
, bot
, and api
.
App configuration is global configuration values that are used throughout the framework.
Bot configuration contains discord-specific values for the bot to use. Values such as token must be set for the discord application to run. It can be disabled via changing enabled = false
in the bot section.
API configuration is for the REST API for external data access. This feature is coming soon.
To run NECos, it's as simple as running ./necos start
, and optionally adding the --debug
flag for extra output messages. (For all flags, see ./necos usage')
NOTE TO SELF: USE NODE_ENV=production NODE_OPTIONS="--loader ts-node/esm" knex migrate:make --knexfile config/dbconfig.ts create_guilds_table TO MAKE THINGS -sky