mirror of
https://github.com/sern-handler/create-bot
synced 2026-06-06 01:16:53 +00:00
add config file setup, more flexible
This commit is contained in:
13
template-ts/src/config.ts
Normal file
13
template-ts/src/config.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
//CONFIG FILE: export only data here and do not cause side effects. Feel free to add your own configuration to this file.
|
||||
|
||||
//commands directory. REQUIRED
|
||||
export const commands = './dist/commands'
|
||||
// events directory.
|
||||
export const events = './dist/events'
|
||||
|
||||
// schedule tasks and declare them here
|
||||
export const tasks = './dist/tasks'
|
||||
|
||||
// defaultPrefix: if omitted, sern will disable all text/prefix commands
|
||||
export const defaultPrefix = '?'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dotenv/config'
|
||||
import * as config from './config.js'
|
||||
import { Client, GatewayIntentBits } from 'discord.js';
|
||||
import { Sern, makeDependencies } from '@sern/handler';
|
||||
import { Publisher } from '@sern/publisher'
|
||||
@@ -24,10 +25,6 @@ await makeDependencies(({ add }) => {
|
||||
});
|
||||
|
||||
//View docs for all options
|
||||
Sern.init({
|
||||
defaultPrefix: '!', // removing defaultPrefix will shut down text commands
|
||||
commands: 'dist/commands',
|
||||
// events: 'dist/events', //(optional)
|
||||
});
|
||||
Sern.init(config);
|
||||
|
||||
await client.login()
|
||||
|
||||
Reference in New Issue
Block a user