mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
/send with return value too
- /send - return message on `sendMessageAsUser` now
This commit is contained in:
@ -4784,7 +4784,7 @@ export function removeMacros(str) {
|
||||
* @param {boolean} [compact] Send as a compact display message.
|
||||
* @param {string} [name] Name of the user sending the message. Defaults to name1.
|
||||
* @param {string} [avatar] Avatar of the user sending the message. Defaults to user_avatar.
|
||||
* @returns {Promise<void>} A promise that resolves when the message is inserted.
|
||||
* @returns {Promise<any>} A promise that resolves to the message when it is inserted.
|
||||
*/
|
||||
export async function sendMessageAsUser(messageText, messageBias, insertAt = null, compact = false, name = name1, avatar = user_avatar) {
|
||||
messageText = getRegexedString(messageText, regex_placement.USER_INPUT);
|
||||
@ -4831,6 +4831,8 @@ export async function sendMessageAsUser(messageText, messageBias, insertAt = nul
|
||||
await eventSource.emit(event_types.USER_MESSAGE_RENDERED, chat_id);
|
||||
await saveChatConditional();
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user