File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " tomoribot" ,
3- "version" : " 0.7.911 " ,
3+ "version" : " 0.7.912 " ,
44 "description" : " Customizable AI Assistant Discord Bot" ,
55 "main" : " ./src/index.ts" ,
66 "type" : " module" ,
Original file line number Diff line number Diff line change @@ -246,7 +246,10 @@ export async function uploadPersonaAvatarToS3(options: AvatarUploadOptions): Pro
246246 }
247247 }
248248
249- // Non-production: store locally and return base64 data URI for Discord embeds
249+ // Non-production: store under data/avatars/ and return the normalized local path.
250+ // Callers store this path in webhook_avatar_url; downstream code resolves it to
251+ // a public URL (if AVATAR_PUBLIC_BASE_URL is set) or loads the buffer directly
252+ // to mutate the shared webhook avatar before each send.
250253 const storedPath = buildLocalStoredPath ( options ) ;
251254 const absolutePath = resolveLocalAvatarPath ( storedPath ) ;
252255 if ( ! absolutePath ) {
@@ -256,12 +259,8 @@ export async function uploadPersonaAvatarToS3(options: AvatarUploadOptions): Pro
256259 try {
257260 await fs . mkdir ( path . dirname ( absolutePath ) , { recursive : true } ) ;
258261 await fs . writeFile ( absolutePath , options . buffer ) ;
259-
260- // Return as base64 data URI so Discord embeds can display it persistently
261- // Unlike attachment:// URLs, data URIs work anywhere and don't expire
262- const base64DataUri = `data:image/png;base64,${ options . buffer . toString ( "base64" ) } ` ;
263- log . success ( `[Avatar Storage] Stored persona avatar${ label } locally (non-production)` ) ;
264- return base64DataUri ;
262+ log . success ( `[Avatar Storage] Stored persona avatar${ label } at ${ storedPath } ` ) ;
263+ return normalizeStoredPath ( storedPath ) ;
265264 } catch ( error ) {
266265 log . warn ( `[Avatar Storage] Failed to store persona avatar${ label } locally` , error ) ;
267266 return null ;
You can’t perform that action at this time.
0 commit comments