add /impersonate (aka /imp)

This commit is contained in:
RossAscends
2023-07-13 16:12:49 +09:00
parent be91af30b8
commit ff8c9546ad

View File

@@ -6786,6 +6786,11 @@ async function importFromURL(items, files) {
}
}
async function doImpersonate() {
$('#send_textarea').val('');
$("#option_impersonate").trigger('click', { fromSlashCommand: true })
}
const isPwaMode = window.navigator.standalone;
if (isPwaMode) { $("body").addClass('PWA') }
@@ -6800,6 +6805,8 @@ $(document).ready(function () {
registerSlashCommand('dupe', DupeChar, [], " duplicates the currently selected character", true, true);
registerSlashCommand('api', connectAPISlash, [], "(kobold, horde, novel, ooba, oai, claude, poe, windowai) connect to an API", true, true);
registerSlashCommand('impersonate', doImpersonate, ['imp'], "- calls an impersonation response", true, true);
setTimeout(function () {
$("#groupControlsToggle").trigger('click');
@@ -7531,7 +7538,7 @@ $(document).ready(function () {
}
else if (id == "option_impersonate") {
if (is_send_press == false) {
if (is_send_press == false || fromSlashCommand) {
is_send_press = true;
Generate("impersonate");
}