refactor: Update getVar function in triggers.ts to handle null values
This commit is contained in:
@@ -100,7 +100,7 @@ export async function runTrigger(char:character,mode:triggerMode, arg:{
|
||||
}
|
||||
|
||||
function getVar(key:string){
|
||||
return `${chat.scriptstate?.['$' + key]}`
|
||||
return `${chat.scriptstate?.['$' + key] ?? "null"}`
|
||||
}
|
||||
|
||||
function setVar(key:string, value:string){
|
||||
|
||||
@@ -657,6 +657,7 @@ export interface Database{
|
||||
combineTranslation:boolean
|
||||
dynamicAssets:boolean
|
||||
dynamicAssetsEditDisplay:boolean
|
||||
|
||||
}
|
||||
|
||||
export interface customscript{
|
||||
|
||||
Reference in New Issue
Block a user