Add setdefaultvar

This commit is contained in:
kwaroran
2024-04-25 00:43:10 +09:00
parent 719040789c
commit eceeb98768

View File

@@ -733,6 +733,7 @@ const matcher = (p1:string,matcherArg:matcherArg) => {
case 'prefill_supported':{
return db.aiModel.startsWith('claude') ? '1' : '0'
}
}
const arra = p1.split("::")
if(arra.length > 1){
@@ -764,6 +765,18 @@ const matcher = (p1:string,matcherArg:matcherArg) => {
}
return null
}
case 'setdefaultvar':{
if(matcherArg.rmVar){
return ''
}
if(matcherArg.runVar){
if(!getChatVar(v)){
setChatVar(v, arra[2])
}
return ''
}
return null
}
case 'button':{
return `<button class="button-default" risu-trigger="${arra[2]}">${arra[1]}</button>`
}
@@ -936,7 +949,8 @@ const matcher = (p1:string,matcherArg:matcherArg) => {
}
case 'date':
case 'time':
case 'datetimeformat':{
case 'datetimeformat':
case 'date_time_format':{
return dateTimeFormat(arra[1])
}
}