Update /newchat command skip popup
This commit is contained in:
parent
f73986d23f
commit
7bf793d2be
|
@ -8551,7 +8551,7 @@ async function doImpersonate(args, prompt) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
async function doNewChat({ deleteCurrentChat = false } = {}) {
|
export async function doNewChat({ deleteCurrentChat = false } = {}) {
|
||||||
//Make a new chat for selected character
|
//Make a new chat for selected character
|
||||||
if ((!selected_group && this_chid == undefined) || menu_type == 'create') {
|
if ((!selected_group && this_chid == undefined) || menu_type == 'create') {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -22,6 +22,7 @@ import {
|
||||||
setActiveGroup,
|
setActiveGroup,
|
||||||
setActiveCharacter,
|
setActiveCharacter,
|
||||||
entitiesFilter,
|
entitiesFilter,
|
||||||
|
doNewChat,
|
||||||
} from '../script.js';
|
} from '../script.js';
|
||||||
import { isMobile, initMovingUI, favsToHotswap } from './RossAscends-mods.js';
|
import { isMobile, initMovingUI, favsToHotswap } from './RossAscends-mods.js';
|
||||||
import {
|
import {
|
||||||
|
@ -39,11 +40,11 @@ import { tokenizers } from './tokenizers.js';
|
||||||
import { BIAS_CACHE } from './logit-bias.js';
|
import { BIAS_CACHE } from './logit-bias.js';
|
||||||
import { renderTemplateAsync } from './templates.js';
|
import { renderTemplateAsync } from './templates.js';
|
||||||
|
|
||||||
import { countOccurrences, debounce, delay, download, getFileText, isOdd, onlyUnique, resetScrollHeight, shuffle, sortMoments, stringToRange, timestampToMoment } from './utils.js';
|
import { countOccurrences, debounce, delay, download, getFileText, isOdd, isTrueBoolean, onlyUnique, resetScrollHeight, shuffle, sortMoments, stringToRange, timestampToMoment } from './utils.js';
|
||||||
import { FILTER_TYPES } from './filters.js';
|
import { FILTER_TYPES } from './filters.js';
|
||||||
import { PARSER_FLAG, SlashCommandParser } from './slash-commands/SlashCommandParser.js';
|
import { PARSER_FLAG, SlashCommandParser } from './slash-commands/SlashCommandParser.js';
|
||||||
import { SlashCommand } from './slash-commands/SlashCommand.js';
|
import { SlashCommand } from './slash-commands/SlashCommand.js';
|
||||||
import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js';
|
import { ARGUMENT_TYPE, SlashCommandArgument, SlashCommandNamedArgument } from './slash-commands/SlashCommandArgument.js';
|
||||||
import { AUTOCOMPLETE_WIDTH } from './autocomplete/AutoComplete.js';
|
import { AUTOCOMPLETE_WIDTH } from './autocomplete/AutoComplete.js';
|
||||||
import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandEnumValue.js';
|
import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandEnumValue.js';
|
||||||
import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
|
import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
|
||||||
|
@ -2530,14 +2531,6 @@ async function resetMovablePanels(type) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function doNewChat() {
|
|
||||||
$('#option_start_new_chat').trigger('click');
|
|
||||||
await delay(1);
|
|
||||||
$('#dialogue_popup_ok').trigger('click');
|
|
||||||
await delay(1);
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the ID of the tag with the given name.
|
* Finds the ID of the tag with the given name.
|
||||||
* @param {string} name
|
* @param {string} name
|
||||||
|
@ -3926,7 +3919,20 @@ $(document).ready(() => {
|
||||||
}));
|
}));
|
||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
name: 'newchat',
|
name: 'newchat',
|
||||||
callback: doNewChat,
|
/** @type {(args: { delete: string?}, string) => Promise<''>} */
|
||||||
|
callback: async (args, _) => {
|
||||||
|
await doNewChat({ deleteCurrentChat: isTrueBoolean(args.delete) });
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
namedArgumentList: [
|
||||||
|
SlashCommandNamedArgument.fromProps({
|
||||||
|
name: 'delete',
|
||||||
|
description: 'delete the current chat',
|
||||||
|
typeList: [ARGUMENT_TYPE.BOOLEAN],
|
||||||
|
defaultValue: 'false',
|
||||||
|
enumList: commonEnumProviders.boolean('trueFalse')(),
|
||||||
|
}),
|
||||||
|
],
|
||||||
helpString: 'Start a new chat with the current character',
|
helpString: 'Start a new chat with the current character',
|
||||||
}));
|
}));
|
||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
|
|
Loading…
Reference in New Issue