Refactor chat message retrieval in parser.ts
This commit is contained in:
@@ -750,8 +750,8 @@ const matcher = (p1:string,matcherArg:matcherArg) => {
|
|||||||
}
|
}
|
||||||
case 'previous_chat_log':{
|
case 'previous_chat_log':{
|
||||||
const selchar = db.characters[get(selectedCharID)]
|
const selchar = db.characters[get(selectedCharID)]
|
||||||
const chat = selchar.chats[selchar.chatPage]
|
const chat = selchar?.chats?.[selchar.chatPage]
|
||||||
return chat.message[chatID - 1].data
|
return chat?.message[chatID - 1]?.data ?? 'Out of range'
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user