@@ -23,6 +23,7 @@ if (isProd) {
2323 width : 1000 ,
2424 height : 800 ,
2525 title : '群聊总结智囊' ,
26+ icon : path . join ( __dirname , '../public/logo.png' ) ,
2627 } ) ;
2728
2829 if ( isProd ) {
@@ -33,11 +34,7 @@ if (isProd) {
3334 // mainWindow.webContents.openDevTools();
3435 }
3536
36-
37- ipcMain . on ( 'summarize' , ( event , {
38- dateDir,
39- chatFileName,
40- } ) => {
37+ ipcMain . on ( 'summarize' , ( event , { dateDir, chatFileName } ) => {
4138 const summarizeEvent = summarize ( path . join ( BASE_PATH , dateDir , chatFileName ) ) ;
4239 summarizeEvent . addListener ( 'update' , ( info ) => {
4340 console . log ( 'summarize update' , info ) ;
@@ -64,7 +61,6 @@ if (isProd) {
6461 } ) ;
6562
6663 ipcMain . on ( 'show-config' , async ( event , config ) => {
67-
6864 mainWindow . webContents . send ( 'show-config' , getConfig ( ) ) ;
6965 } ) ;
7066
@@ -78,23 +74,25 @@ if (isProd) {
7874 ipcMain . on ( 'open-url' , ( e , url ) => {
7975 shell . openExternal ( url ) ;
8076 } ) ;
81- ipcMain . on ( 'send-summarize' , async ( e , {
82- dateDir ,
83- chatFileName,
84- } ) => {
85- await sendImage ( chatFileName . replace ( '.txt' , '' ) , path . join ( BASE_PATH , dateDir , chatFileName . replace ( '.txt' , ' 的今日群聊总结.png' ) ) ) ;
77+ ipcMain . on ( 'send-summarize' , async ( e , { dateDir , chatFileName } ) => {
78+ await sendImage (
79+ chatFileName . replace ( '.txt' , '' ) ,
80+ path . join ( BASE_PATH , dateDir , chatFileName . replace ( '.txt' , ' 的今日群聊总结.png' ) )
81+ ) ;
8682 await delay ( 1000 ) ;
87- await sendAudio ( chatFileName . replace ( '.txt' , '' ) , path . join ( BASE_PATH , dateDir , chatFileName . replace ( '.txt' , ' 的今日群聊总结.mp3' ) ) ) ;
83+ await sendAudio (
84+ chatFileName . replace ( '.txt' , '' ) ,
85+ path . join ( BASE_PATH , dateDir , chatFileName . replace ( '.txt' , ' 的今日群聊总结.mp3' ) )
86+ ) ;
8887 await delay ( 1000 ) ;
89- await sendText ( chatFileName . replace ( '.txt' , '' ) , '主人们,智囊 AI 为您奉上今日群聊总结,祝您用餐愉快!由开源项目 wx.zhinang.ai 生成' ) ;
88+ await sendText (
89+ chatFileName . replace ( '.txt' , '' ) ,
90+ '主人们,智囊 AI 为您奉上今日群聊总结,祝您用餐愉快!由开源项目 wx.zhinang.ai 生成'
91+ ) ;
9092 mainWindow . webContents . send ( 'toast' , `发送成功` ) ;
9193 } ) ;
92-
93-
9494} ) ( ) ;
9595
9696app . on ( 'window-all-closed' , ( ) => {
9797 app . quit ( ) ;
9898} ) ;
99-
100-
0 commit comments