summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authordank074 <torresefrain10@gmail.com>2025-07-07 14:55:36 -0500
committerRory& <root@rory.gay>2025-07-07 22:13:39 +0200
commit5437dab688cf82f7edf8d09bd8370db58851697c (patch)
treeaba46263e2506c5b4281638cc682a85ddc97251a /src
parentAdd emoji source endpoint (diff)
downloadserver-ts-5437dab688cf82f7edf8d09bd8370db58851697c.tar.xz
fix unbundled startup for webrtc, and enable eslint
Diffstat (limited to 'src')
-rw-r--r--src/webrtc/opcodes/Identify.ts2
-rw-r--r--src/webrtc/opcodes/index.ts5
-rw-r--r--src/webrtc/start.ts3
-rw-r--r--src/webrtc/util/MediaServer.ts1
4 files changed, 8 insertions, 3 deletions
diff --git a/src/webrtc/opcodes/Identify.ts b/src/webrtc/opcodes/Identify.ts

index 9bcaa673d..29b85e1da 100644 --- a/src/webrtc/opcodes/Identify.ts +++ b/src/webrtc/opcodes/Identify.ts
@@ -46,7 +46,7 @@ export async function onIdentify(this: WebRtcWebSocket, data: VoicePayload) { let authenticated = false; // first check if its a guild voice connection or DM voice call - let voiceState = await VoiceState.findOne({ + const voiceState = await VoiceState.findOne({ where: [ { guild_id: server_id, user_id, token, session_id }, { channel_id: server_id, user_id, token, session_id }, diff --git a/src/webrtc/opcodes/index.ts b/src/webrtc/opcodes/index.ts
index 71c5f2e74..da561f80e 100644 --- a/src/webrtc/opcodes/index.ts +++ b/src/webrtc/opcodes/index.ts
@@ -24,7 +24,10 @@ import { onSelectProtocol } from "./SelectProtocol"; import { onSpeaking } from "./Speaking"; import { onVideo } from "./Video"; -export type OPCodeHandler = (this: WebRtcWebSocket, data: VoicePayload) => any; +export type OPCodeHandler = ( + this: WebRtcWebSocket, + data: VoicePayload, +) => Promise<void>; export default { [VoiceOPCodes.HEARTBEAT]: onHeartbeat, diff --git a/src/webrtc/start.ts b/src/webrtc/start.ts
index 1793b3916..cce1c16c2 100644 --- a/src/webrtc/start.ts +++ b/src/webrtc/start.ts
@@ -15,7 +15,8 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ - +import moduleAlias from "module-alias"; +moduleAlias(__dirname + "../../../package.json"); process.on("uncaughtException", console.error); process.on("unhandledRejection", console.error); diff --git a/src/webrtc/util/MediaServer.ts b/src/webrtc/util/MediaServer.ts
index 793419c6f..1c7e220ae 100644 --- a/src/webrtc/util/MediaServer.ts +++ b/src/webrtc/util/MediaServer.ts
@@ -50,6 +50,7 @@ export const loadWebRtcLibrary = async () => { if (!selectedWrtcLibrary) throw new NoConfiguredLibraryError("No library configured in .env"); + // eslint-disable-next-line @typescript-eslint/ban-ts-comment mediaServer = new // @ts-ignore (await import(selectedWrtcLibrary)).default();