mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add AN slash command
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { chat_metadata, saveSettingsDebounced } from "../../../script.js";
|
||||
import { extension_settings, getContext } from "../../extensions.js";
|
||||
import { registerSlashCommand } from "../../slash-commands.js";
|
||||
import { debounce } from "../../utils.js";
|
||||
export { MODULE_NAME };
|
||||
|
||||
@ -19,6 +20,10 @@ const metadata_keys = {
|
||||
position: 'note_position',
|
||||
}
|
||||
|
||||
function setNoteCommand(_, text) {
|
||||
$('#extension_floating_prompt').val(text).trigger('input');
|
||||
}
|
||||
|
||||
async function onExtensionFloatingPromptInput() {
|
||||
chat_metadata[metadata_keys.prompt] = $(this).val();
|
||||
saveMetadataDebounced();
|
||||
@ -180,4 +185,5 @@ async function moduleWorker() {
|
||||
|
||||
addExtensionsSettings();
|
||||
setInterval(moduleWorkerWrapper, UPDATE_INTERVAL);
|
||||
registerSlashCommand('note', setNoteCommand, [], " – sets an author's note for the currently selected chat", true, true);
|
||||
})();
|
Reference in New Issue
Block a user