Move CHAT_CHANGED injects revive listener to initDefaultSlashCommands
| @@ -179,7 +179,7 @@ import { | ||
| 179 | 179 | import { debounce_timeout, IGNORE_SYMBOL } from './scripts/constants.js'; |
| 180 | 180 | |
| 181 | 181 | import { cancelDebouncedMetadataSave, doDailyExtensionUpdatesCheck, extension_settings, initExtensions, loadExtensionSettings, runGenerationInterceptors, saveMetadataDebounced } from './scripts/extensions.js'; |
| 182 | 182 | import { COMMENT_NAME_DEFAULT, CONNECT_API_MAP, executeSlashCommandsOnChatInput, getSlashCommandsHelp, initDefaultSlashCommands, isExecutingCommandsFromChatInput, pauseScriptExecution, processChatSlashCommands, stopScriptExecution, UNIQUE_APIS } from './scripts/slash-commands.js'; |
| 183 | 183 | import { |
| 184 | 184 | tag_map, |
| 185 | 185 | tags, |
| @@ -423,8 +423,6 @@ export const event_types = { | ||
| 423 | 423 | |
| 424 | 424 | export const eventSource = new EventEmitter([event_types.APP_READY]); |
| 425 | 425 | |
| 426 | -eventSource.on(event_types.CHAT_CHANGED, processChatSlashCommands); | |
| 427 | - | |
| 428 | 426 | export const characterGroupOverlay = new BulkEditOverlay(); |
| 429 | 427 | const characterContextMenu = new CharacterContextMenu(characterGroupOverlay); |
| 430 | 428 | eventSource.on(event_types.CHARACTER_PAGE_LOADED, characterGroupOverlay.onPageLoad); |
| @@ -213,6 +213,7 @@ function setupConnectAPIMap() { | ||
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | export function initDefaultSlashCommands() { |
| 216 | + eventSource.on(event_types.CHAT_CHANGED, processChatSlashCommands); | |
| 216 | 217 | setupConnectAPIMap(); |
| 217 | 218 | |
| 218 | 219 | async function enableInstructCallback() { |