Skip to content

Configuring Lightning

Lightning is configured using a config.ts, allowing you to import and configure the bot and plugins in the same place.

Example

ts
import type { config } from 'jsr:@jersey/lightning@0.8.0';
import { discord_plugin } from 'jsr:@jersey/lightning-plugin-discord@0.8.0'; 
import { guilded_plugin } from 'jsr:@jersey/lightning-plugin-guilded@0.8.0'; 

export default {
	prefix: '!',
	database: {
		type: 'postgres',
		config: {
			user: 'server',
			database: 'lightning',
			hostname: 'postgres',
			port: 5432,
			host_type: 'tcp',
		},
	},
	plugins: [ 
		discord_plugin.new({ 
			token: 'your_token', 
			application_id: 'your_application_id', 
			slash_commands: true, 
		}), 
	], 
} as config;

Properties

nametypenotes
error_urlstring?Discord-compatible webhook for error logging
databasedatabase_configSee configuring a database
pluginscreate_plugin<any>[]?See plugins
prefixstringThe prefix used for commands