/send with return value too

- /send
- return message on `sendMessageAsUser` now
This commit is contained in:
Wolfsblvt
2024-09-30 18:32:21 +02:00
parent 0ab74f0819
commit 1128de91f4
2 changed files with 8 additions and 4 deletions

View File

@ -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;
}
/**