mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Add {{// (note)}} macro (#1265)
* add {{# (note)}} macro
* change from # to // for future updates
* fix docs
			
			
This commit is contained in:
		| @@ -1685,11 +1685,14 @@ function substituteParams(content, _name1, _name2, _original, _group) { | ||||
|     content = content.replace(/<CHARIFNOTGROUP>/gi, _group); | ||||
|     content = content.replace(/<GROUP>/gi, _group); | ||||
|  | ||||
|     content = content.replace(/\{\{\/\/(.*?)\}\}/g, ""); | ||||
|  | ||||
|     content = content.replace(/{{time}}/gi, moment().format('LT')); | ||||
|     content = content.replace(/{{date}}/gi, moment().format('LL')); | ||||
|     content = content.replace(/{{weekday}}/gi, moment().format('dddd')); | ||||
|     content = content.replace(/{{isotime}}/gi, moment().format('HH:mm')); | ||||
|     content = content.replace(/{{isodate}}/gi, moment().format('YYYY-MM-DD')); | ||||
|      | ||||
|     content = content.replace(/{{datetimeformat +([^}]*)}}/gi, (_, format) => { | ||||
|         const formattedTime = moment().format(format); | ||||
|         return formattedTime; | ||||
|   | ||||
| @@ -3,6 +3,7 @@ System-wide Replacement Macros: | ||||
|     <li><tt>{{user}}</tt> - your current Persona username</li> | ||||
|     <li><tt>{{char}}</tt> - the Character's name</li> | ||||
|     <li><tt>{{input}}</tt> - the user input</li> | ||||
|     <li><tt>{{// (note)}}</tt> - you can leave a note here, and the macro will be replaced with blank content</li> | ||||
|     <li><tt>{{time}}</tt> - the current time</li> | ||||
|     <li><tt>{{date}}</tt> - the current date</li> | ||||
|     <li><tt>{{weekday}}</tt> - the current weekday</li> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user