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){
|
function getVar(key:string){
|
||||||
return `${chat.scriptstate?.['$' + key]}`
|
return `${chat.scriptstate?.['$' + key] ?? "null"}`
|
||||||
}
|
}
|
||||||
|
|
||||||
function setVar(key:string, value:string){
|
function setVar(key:string, value:string){
|
||||||
|
|||||||
@@ -657,6 +657,7 @@ export interface Database{
|
|||||||
combineTranslation:boolean
|
combineTranslation:boolean
|
||||||
dynamicAssets:boolean
|
dynamicAssets:boolean
|
||||||
dynamicAssetsEditDisplay:boolean
|
dynamicAssetsEditDisplay:boolean
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface customscript{
|
export interface customscript{
|
||||||
|
|||||||
Reference in New Issue
Block a user