mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Author's Notes: Add per-character author's note
Adds the option to override the chat's author's note with one set for each character. This saves the pain of having to copy and paste author's notes for every chat. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { getContext } from "./extensions.js";
|
||||
|
||||
export function onlyUnique(value, index, array) {
|
||||
return array.indexOf(value) === index;
|
||||
}
|
||||
@ -420,3 +422,12 @@ export function isDataURL(str) {
|
||||
const regex = /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)*;?)?(base64)?,([a-z0-9!$&',()*+;=\-_%.~:@\/?#]+)?$/i;
|
||||
return regex.test(str);
|
||||
}
|
||||
|
||||
export function getCharaFilename() {
|
||||
const context = getContext();
|
||||
const fileName = context.characters[context.characterId].avatar;
|
||||
|
||||
if (fileName) {
|
||||
return fileName.replace(/\.[^/.]+$/, "")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user