2025-05-18 22:24:48 +07:00
|
|
|
import { AppStartPerformance } from '@revenge-mod/discord/preinit'
|
2025-04-30 23:49:15 +07:00
|
|
|
|
2025-05-13 10:28:55 +07:00
|
|
|
import { PluginFlags } from '@revenge-mod/plugins/constants'
|
2025-05-01 01:18:36 +07:00
|
|
|
import { InternalPluginFlags, registerPlugin } from '@revenge-mod/plugins/_'
|
2025-04-30 23:49:15 +07:00
|
|
|
|
|
|
|
|
AppStartPerformance.mark('👊', 'Plugins register')
|
|
|
|
|
|
|
|
|
|
const tsReg = performance.now()
|
2025-05-18 22:24:48 +07:00
|
|
|
let tsPreInit: number
|
2025-04-30 23:49:15 +07:00
|
|
|
let tsInit: number
|
|
|
|
|
|
|
|
|
|
registerPlugin(
|
|
|
|
|
{
|
2025-05-01 01:29:55 +07:00
|
|
|
id: 'revenge.logging',
|
|
|
|
|
name: 'Logging',
|
|
|
|
|
description: "Extra logging for Revenge's internal modules",
|
2025-05-01 12:18:28 +07:00
|
|
|
author: 'Revenge',
|
2025-05-01 01:29:55 +07:00
|
|
|
icon: 'PaperIcon',
|
2025-04-30 23:49:15 +07:00
|
|
|
},
|
|
|
|
|
{
|
2025-05-18 22:24:48 +07:00
|
|
|
preInit() {
|
|
|
|
|
tsPreInit = performance.now()
|
|
|
|
|
AppStartPerformance.mark('👊', 'Plugins preInit', tsPreInit - tsReg)
|
|
|
|
|
},
|
2025-04-30 23:49:15 +07:00
|
|
|
init() {
|
|
|
|
|
tsInit = performance.now()
|
2025-05-18 22:24:48 +07:00
|
|
|
AppStartPerformance.mark('👊', 'Plugins init', tsInit - tsPreInit)
|
2025-04-30 23:49:15 +07:00
|
|
|
},
|
2025-05-01 01:29:55 +07:00
|
|
|
start({ logger }) {
|
2025-04-30 23:49:15 +07:00
|
|
|
AppStartPerformance.mark('👊', 'Plugins start', performance.now() - tsInit)
|
2025-05-01 01:29:55 +07:00
|
|
|
logger.log(
|
2025-05-04 16:49:17 +07:00
|
|
|
`👊 Revenge. Discord, your way. (${__BUILD_VERSION__}-${__BUILD_COMMIT__}-${__BUILD_BRANCH__} (${__BUILD_ENV__}))`,
|
2025-05-01 01:29:55 +07:00
|
|
|
)
|
2025-04-30 23:49:15 +07:00
|
|
|
},
|
|
|
|
|
},
|
2025-05-01 01:18:36 +07:00
|
|
|
PluginFlags.Enabled,
|
|
|
|
|
InternalPluginFlags.Internal,
|
2025-04-30 23:49:15 +07:00
|
|
|
)
|