feat: Add first_msg_index curly syntax (#436)

# PR Checklist
- [v] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [v] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [v] Did you added a type def?

# Description

Add a curly syntax for retrieving the index for the selected alternate
first message. {{first_msg_index}} replaced with -1 if the default first
message is being used, otherwise it's replace with the selected index of
alternate first message.
This commit is contained in:
kwaroran
2024-05-24 11:31:37 +09:00
committed by GitHub

View File

@@ -535,6 +535,13 @@ const matcher = (p1:string,matcherArg:matcherArg) => {
case 'chat_index':{
return chatID.toString()
}
case 'first_msg_index':{
if(chatID !== -1){
const selchar = db.characters[get(selectedCharID)]
return selchar.firstMsgIndex
}
return null;
}
case 'blank':
case 'none':{
return ''