[feat] Add support for chat stickers (#178)
# PR Checklist - [x] Did you check if it works normally in all models? *ignore this when it dosen't uses models* - [x] 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? - [x] Did you added a type def? # Description - This commit adds support for chat stickers by allowing users to use stickers in chat message window. - The users can toggle show additional asset list using a button. - Added Additional assets file extension data. - Added option for additional assets preview. - Optimized render when use streaming api. (prevent markdown again when message not changed) Added controls to Video/Audio Assets [Video11.webm](https://github.com/kwaroran/RisuAI/assets/11344967/8980282f-d001-4afc-a6d9-6f6369b4cd4c) [Video12.webm](https://github.com/kwaroran/RisuAI/assets/11344967/e0e153b8-eba6-48a5-b47d-d2dd287f32fd)
This commit is contained in:
@@ -329,7 +329,7 @@ async function importSpecv2(card:CharacterCardV2, img?:Uint8Array, mode?:'hub'|'
|
||||
let customScripts:customscript[] = []
|
||||
let utilityBot = false
|
||||
let sdData = defaultSdDataFunc()
|
||||
let extAssets:[string,string][] = []
|
||||
let extAssets:[string,string,string][] = []
|
||||
|
||||
if(risuext){
|
||||
if(risuext.emotions){
|
||||
@@ -350,8 +350,11 @@ async function importSpecv2(card:CharacterCardV2, img?:Uint8Array, mode?:'hub'|'
|
||||
msg: `Loading... (Getting Assets ${i} / ${risuext.additionalAssets.length})`
|
||||
})
|
||||
await sleep(10)
|
||||
const imgp = await saveAsset(mode === 'hub' ? (await getHubResources(risuext.additionalAssets[i][1])) :Buffer.from(risuext.additionalAssets[i][1], 'base64'))
|
||||
extAssets.push([risuext.additionalAssets[i][0],imgp])
|
||||
let fileName = ''
|
||||
if(risuext.additionalAssets[i].length >= 3)
|
||||
fileName = risuext.additionalAssets[i][2]
|
||||
const imgp = await saveAsset(mode === 'hub' ? (await getHubResources(risuext.additionalAssets[i][1])) :Buffer.from(risuext.additionalAssets[i][1], 'base64'), '', fileName)
|
||||
extAssets.push([risuext.additionalAssets[i][0],imgp,fileName])
|
||||
}
|
||||
}
|
||||
bias = risuext.bias ?? bias
|
||||
@@ -756,7 +759,7 @@ type CharacterCardV2 = {
|
||||
customScripts?:customscript[]
|
||||
utilityBot?: boolean,
|
||||
sdData?:[string,string][],
|
||||
additionalAssets?:[string,string][],
|
||||
additionalAssets?:[string,string,string][],
|
||||
backgroundHTML?:string
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user