Skip to content

Commit 2a51fd6

Browse files
committed
fix: drop request and use fetch
1 parent 4ded13e commit 2a51fd6

File tree

3 files changed

+85
-492
lines changed

3 files changed

+85
-492
lines changed

app.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'dotenv/config';
33
import { io, Socket } from 'socket.io-client';
44
import { spawn } from 'node:child_process';
55
import player from 'play-sound';
6-
import request from 'request';
76

87
type PlayUrl = {
98
url: string;
@@ -42,7 +41,7 @@ function playClip(roomName: string, data: PlayClip): void {
4241
if (process.env.USE_LOCAL_SOUNDS === 'true') {
4342
player().play(`static/clips/${data.file}`);
4443
} else {
45-
request(`${urlForRoom(roomName)}/clip/${file}/${volume}`);
44+
fetch(`${urlForRoom(roomName)}/clip/${file}/${volume}`);
4645
}
4746
}
4847

@@ -62,7 +61,7 @@ function sayClip(roomName: string, data: PlayText): void {
6261
if (process.env.USE_LOCAL_SOUNDS === 'true') {
6362
localSay(text);
6463
} else {
65-
request(`${urlForRoom(roomName)}/say/${text}/${volume}`);
64+
fetch(`${urlForRoom(roomName)}/say/${text}/${volume}`);
6665
}
6766
}
6867

0 commit comments

Comments
 (0)