mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-26 22:58:21 -04:00
New plugin: VoiceMessages (#1380)
Co-authored-by: V <vendicated@riseup.net> Co-authored-by: Justice Almanzar <superdash993@gmail.com>
This commit is contained in:
parent
198b35ffdc
commit
8620a1d86d
16 changed files with 660 additions and 37 deletions
|
@ -17,8 +17,10 @@
|
|||
*/
|
||||
|
||||
import { IpcEvents } from "@utils/IpcEvents";
|
||||
import { ipcMain } from "electron";
|
||||
import { app, ipcMain } from "electron";
|
||||
import { readFile } from "fs/promises";
|
||||
import { request } from "https";
|
||||
import { join } from "path";
|
||||
|
||||
// #region OpenInApp
|
||||
// These links don't support CORS, so this has to be native
|
||||
|
@ -44,3 +46,17 @@ ipcMain.handle(IpcEvents.OPEN_IN_APP__RESOLVE_REDIRECT, async (_, url: string) =
|
|||
return getRedirect(url);
|
||||
});
|
||||
// #endregion
|
||||
|
||||
|
||||
// #region VoiceMessages
|
||||
ipcMain.handle(IpcEvents.VOICE_MESSAGES_READ_RECORDING, async () => {
|
||||
const path = join(app.getPath("userData"), "module_data/discord_voice/recording.ogg");
|
||||
try {
|
||||
const buf = await readFile(path);
|
||||
return new Uint8Array(buf.buffer);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
// #endregion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue