Store bot configuration WIP

This commit is contained in:
John Livingston
2023-09-15 17:55:07 +02:00
parent 231ca3d177
commit 35c9494ed7
7 changed files with 3916 additions and 988 deletions

View File

@ -10,6 +10,7 @@ import { prepareProsody, ensureProsodyRunning, ensureProsodyNotRunning } from '.
import { unloadDebugMode } from './lib/debug'
import { loadLoc } from './lib/loc'
import { RoomChannel } from './lib/room-channel'
import { BotConfiguration } from './lib/configuration/bot'
import decache from 'decache'
// FIXME: Peertube unregister don't have any parameter.
@ -27,6 +28,8 @@ async function register (options: RegisterServerOptions): Promise<any> {
// First: load languages files, so we can localize strings.
await loadLoc()
// Then load the BotConfiguration singleton
await BotConfiguration.initSingleton(options)
// Then load the RoomChannel singleton
const roomChannelSingleton = await RoomChannel.initSingleton(options)
// roomChannelNeedsDataInit: if true, means that the data file does not exist (or is invalid), so we must initiate it