11import { moduleLogger } from "#common/logger/index.ts" ;
2- import { onBotInit } from "#discord/extensionPoints.ts" ;
3- import type { SquirrelDiscordContext } from "#discord/index.ts" ;
4- import { EventListenerPhase } from "#extensionPoint.ts" ;
52import { definePlugin } from "#plugin.ts" ;
63import commandCache from "#plugins/core/commandEngine/commandCache.ts" ;
74import autoCompleteHandler from "#plugins/core/commandEngine/handler/autocompleteHandler.ts" ;
@@ -14,15 +11,12 @@ import groups from "#plugins/core/commands/groups.ts";
1411import help from "#plugins/core/commands/help/index.ts" ;
1512import { CoreConfig } from "#plugins/core/config.ts" ;
1613import configSync from "#plugins/core/configSync.ts" ;
17- import { installWrappedListener } from "#plugins/core/eventWrapper .ts" ;
14+ import eventDispatcher from "#plugins/core/eventDispatcher .ts" ;
1815import guildInfoSync from "#plugins/core/guildInfoSync.ts" ;
1916import configRoutes from "#plugins/core/http/configRoutes.ts" ;
2017import iconSync from "#plugins/core/iconSync.ts" ;
2118import { ConfigStore } from "#plugins/core/public/configStore.ts" ;
22- import {
23- defineConfig ,
24- onBotEvent ,
25- } from "#plugins/core/public/extensionPoints.ts" ;
19+ import { defineConfig } from "#plugins/core/public/extensionPoints.ts" ;
2620
2721const logger = moduleLogger ( ) ;
2822
@@ -58,14 +52,13 @@ export default definePlugin({
5852 ...configSync ,
5953 ...iconSync ,
6054
55+ ...eventDispatcher ,
6156 ...commandCache ,
6257 ...prefixHandler ,
6358 ...slashHandler ,
6459 ...autoCompleteHandler ,
6560 ...componentHandler ,
6661
67- onBotInit ( postInit , EventListenerPhase . Post ) ,
68-
6962 help ,
7063 about ,
7164 ...access ,
@@ -74,15 +67,3 @@ export default definePlugin({
7467 configRoutes ,
7568 ] ,
7669} ) ;
77-
78- function postInit ( ctx : SquirrelDiscordContext ) : void {
79- logger . debug ?.( "Installing onBotEvent listeners" ) ;
80-
81- for ( const listener of onBotEvent . contributions ) {
82- installWrappedListener (
83- ctx ,
84- listener . type ,
85- listener . listener . bind ( listener ) ,
86- ) ;
87- }
88- }
0 commit comments