New context methods, added type parameters to message events

This commit is contained in:
bmen25124
2025-03-12 21:21:23 +03:00
parent 1b02426df1
commit ddb77732f2
5 changed files with 29 additions and 24 deletions

View File

@ -3628,14 +3628,14 @@ export async function sendMessageAs(args, text) {
if (!isNaN(insertAt) && insertAt >= 0 && insertAt <= chat.length) {
chat.splice(insertAt, 0, message);
await saveChatConditional();
await eventSource.emit(event_types.MESSAGE_RECEIVED, insertAt);
await eventSource.emit(event_types.MESSAGE_RECEIVED, insertAt, 'command');
await reloadCurrentChat();
await eventSource.emit(event_types.CHARACTER_MESSAGE_RENDERED, insertAt);
await eventSource.emit(event_types.CHARACTER_MESSAGE_RENDERED, insertAt, 'command');
} else {
chat.push(message);
await eventSource.emit(event_types.MESSAGE_RECEIVED, (chat.length - 1));
await eventSource.emit(event_types.MESSAGE_RECEIVED, (chat.length - 1), 'command');
addOneMessage(message);
await eventSource.emit(event_types.CHARACTER_MESSAGE_RENDERED, (chat.length - 1));
await eventSource.emit(event_types.CHARACTER_MESSAGE_RENDERED, (chat.length - 1), 'command');
await saveChatConditional();
}