mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
V3 spec (IMPORT ONLY)
This commit is contained in:
@@ -296,6 +296,7 @@ export function evaluateMacros(content, env) {
|
||||
// Legacy non-macro substitutions
|
||||
content = content.replace(/<USER>/gi, typeof env.user === 'function' ? env.user() : env.user);
|
||||
content = content.replace(/<BOT>/gi, typeof env.char === 'function' ? env.char() : env.char);
|
||||
content = content.replace(/<CHAR>/gi, typeof env.char === 'function' ? env.char() : env.char);
|
||||
content = content.replace(/<CHARIFNOTGROUP>/gi, typeof env.group === 'function' ? env.group() : env.group);
|
||||
content = content.replace(/<GROUP>/gi, typeof env.group === 'function' ? env.group() : env.group);
|
||||
|
||||
|
@@ -633,6 +633,9 @@ function parseTimestamp(timestamp) {
|
||||
|
||||
// Unix time (legacy TAI / tags)
|
||||
if (typeof timestamp === 'number') {
|
||||
if (isNaN(timestamp) || !isFinite(timestamp) || timestamp < 0) {
|
||||
return moment.invalid();
|
||||
}
|
||||
return moment(timestamp);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user