refactor name and icon get
This commit is contained in:
@@ -5,7 +5,7 @@ import { ChatTokenizer, tokenize, tokenizeNum } from "../tokenizer";
|
||||
import { language } from "../../lang";
|
||||
import { alertError } from "../alert";
|
||||
import { loadLoreBookPrompt, loadLoreBookV3Prompt } from "./lorebook";
|
||||
import { findCharacterbyId, getAuthorNoteDefaultText, isLastCharPunctuation, trimUntilPunctuation } from "../util";
|
||||
import { findCharacterbyId, getAuthorNoteDefaultText, getUserName, isLastCharPunctuation, trimUntilPunctuation } from "../util";
|
||||
import { requestChatData } from "./request";
|
||||
import { stableDiff } from "./stableDiff";
|
||||
import { processScript, processScriptFull, risuChatParser } from "./scripts";
|
||||
@@ -574,7 +574,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
}
|
||||
}
|
||||
|
||||
const examples = exampleMessage(currentChar, db.username)
|
||||
const examples = exampleMessage(currentChar, getUserName())
|
||||
|
||||
for(const example of examples){
|
||||
currentTokens += await tokenizer.tokenizeChat(example)
|
||||
@@ -634,7 +634,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
}
|
||||
}
|
||||
else if(msg.role === 'user'){
|
||||
name = `${db.username}`
|
||||
name = `${getUserName()}`
|
||||
}
|
||||
if(!msg.chatId){
|
||||
msg.chatId = v4()
|
||||
|
||||
Reference in New Issue
Block a user