Files
LLOneBot/src/main/ipcsend.ts
2024-04-30 11:24:33 +08:00

13 lines
318 B
TypeScript

import { webContents } from 'electron'
function sendIPCMsg(channel: string, ...data: any) {
let contents = webContents.getAllWebContents()
for (const content of contents) {
try {
content.send(channel, ...data)
} catch (e) {
console.log('llonebot send ipc msg to render error:', e)
}
}
}