Skip to content

Commit

Permalink
fix: discord-voip issues
Browse files Browse the repository at this point in the history
  • Loading branch information
twlite committed Oct 4, 2024
1 parent 75a1283 commit 853f44b
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 75 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@
"typescript": "^5.2.2",
"vitest": "^0.34.6"
}
}
}
5 changes: 3 additions & 2 deletions packages/discord-player/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord-player",
"version": "7.0.0-dev.0",
"version": "7.0.0-dev.1",
"description": "Complete framework to facilitate music commands using discord.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -57,7 +57,7 @@
"@discord-player/ffmpeg": "workspace:^",
"@discord-player/utils": "workspace:^",
"@web-scrobbler/metadata-filter": "^3.1.0",
"discord-voip": "^0.1.3",
"discord-voip": "workspace:^",
"libsodium-wrappers": "^0.7.13"
},
"peerDependencies": {
Expand All @@ -72,6 +72,7 @@
"discord.js": "^14.15.3",
"eris": "^0.17.2",
"opusscript": "^0.0.8",
"prism-media": "^1.3.5",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
Expand Down
5 changes: 3 additions & 2 deletions packages/discord-player/src/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { VoiceUtils } from './VoiceInterface/VoiceUtils';
import { PlayerEvents, QueryType, SearchOptions, PlayerInitOptions, PlaylistInitData, SearchQueryType, PlayerEvent } from './types/types';
import { QueryResolver, ResolvedQuery } from './utils/QueryResolver';
import { Util } from './utils/Util';
import { generateDependencyReport, version as dVoiceVersion } from 'discord-voip';
import { version as dVoiceVersion } from 'discord-voip';
import { ExtractorExecutionContext } from './extractors/ExtractorExecutionContext';
import { BaseExtractor } from './extractors/BaseExtractor';
import * as _internals from './utils/__internal__';
Expand All @@ -19,6 +19,7 @@ import { Context, createContext } from './hooks';
import { HooksCtx } from './hooks/common';
import { LrcLib } from './lrclib/LrcLib';
import { getCompatName, isClientProxy } from './compat/createErisCompat';
import { DependencyReportGenerator } from './utils/DependencyReportGenerator';

const kSingleton = Symbol('InstanceDiscordPlayerSingleton');

Expand Down Expand Up @@ -685,7 +686,7 @@ export class Player extends PlayerEventsEmitter<PlayerEvents> {
})
.join('\n') || 'N/A',
'\n\ndiscord-voip',
generateDependencyReport()
DependencyReportGenerator.generateString()
];

return depsReport.join('\n');
Expand Down
1 change: 1 addition & 0 deletions packages/discord-player/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export * from './Player';
export * from './hooks';
export * from './utils/IPRotator';
export * from './utils/serde';
export * from './utils/DependencyReportGenerator';
export {
AudioFilters as PCMAudioFilters,
type BiquadFilters,
Expand Down
6 changes: 4 additions & 2 deletions packages/discord-player/src/utils/FFmpegStream.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { Duplex, Readable } from 'stream';
import * as prism from 'prism-media';
import { FFmpeg } from '@discord-player/ffmpeg';

// @ts-ignore
import * as prism from 'prism-media';

export interface FFmpegStreamOptions {
fmt?: string;
encoderArgs?: string[];
Expand Down Expand Up @@ -67,7 +69,7 @@ export function createFFmpegStream(stream: Readable | Duplex | string, options?:

const FFMPEG = getFFmpegProvider(!!options.useLegacyFFmpeg);

const transcoder = new FFMPEG({ shell: false, args });
const transcoder: Duplex = new FFMPEG({ shell: false, args });

transcoder.on('close', () => transcoder.destroy());

Expand Down
2 changes: 1 addition & 1 deletion packages/discord-voip/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord-voip",
"version": "7.0.0-dev.0",
"version": "7.0.0-dev.1",
"description": "Discord VoIP library used by discord-player",
"keywords": [
"discord-player",
Expand Down
5 changes: 4 additions & 1 deletion packages/discord-voip/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export {
type VoiceConnectionDisconnectedWebSocketState,
VoiceConnectionDisconnectReason,
type VoiceConnectionReadyState,
type VoiceConnectionSignallingState,
type VoiceConnectionSignallingState
} from './VoiceConnection';

export { type JoinConfig, getVoiceConnection, getVoiceConnections, getGroups } from './DataStore';

// eslint-disable-next-line @typescript-eslint/no-inferrable-types
export const version: string = '[VI]{{inject}}[/VI]';
2 changes: 1 addition & 1 deletion packages/equalizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@
"readmeFile": "./README.md",
"tsconfig": "./tsconfig.json"
}
}
}
2 changes: 1 addition & 1 deletion packages/extractor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
"readmeFile": "./README.md",
"tsconfig": "./tsconfig.json"
}
}
}
2 changes: 1 addition & 1 deletion packages/ffmpeg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
"typescript": "^5.2.2",
"vitest": "^0.34.6"
}
}
}
2 changes: 1 addition & 1 deletion packages/opus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
"typescript": "^5.2.2",
"vitest": "^0.34.6"
}
}
}
2 changes: 1 addition & 1 deletion packages/tsconfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
"devDependencies": {
"typescript": "^5.2.2"
}
}
}
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
"readmeFile": "./README.md",
"tsconfig": "./tsconfig.json"
}
}
}
63 changes: 3 additions & 60 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,6 @@ __metadata:
languageName: unknown
linkType: soft

"@discord-player/ffmpeg@npm:^0.1.0":
version: 0.1.0
resolution: "@discord-player/ffmpeg@npm:0.1.0"
checksum: 10/a4cb89a64d8e19b116175998be46d0870995c365a8ec602c211f34073f34616f959f61e925c1be56a168abba28b521bc1c3ede038915d5d8c7b206a9b21ab0f7
languageName: node
linkType: hard

"@discord-player/ffmpeg@workspace:^, @discord-player/ffmpeg@workspace:packages/ffmpeg":
version: 0.0.0-use.local
resolution: "@discord-player/ffmpeg@workspace:packages/ffmpeg"
Expand All @@ -159,13 +152,6 @@ __metadata:
languageName: unknown
linkType: soft

"@discord-player/opus@npm:^0.1.2":
version: 0.1.2
resolution: "@discord-player/opus@npm:0.1.2"
checksum: 10/91ad76c6fb15d3f11968ac03340659e19bbc0145031079b7739e17abc344a33b6c03da7314eb844186dbe1c419cd690a99a9ad8e7be20c8f1a1d05fd0fc3722f
languageName: node
linkType: hard

"@discord-player/opus@workspace:^, @discord-player/opus@workspace:packages/opus":
version: 0.0.0-use.local
resolution: "@discord-player/opus@workspace:packages/opus"
Expand Down Expand Up @@ -6505,13 +6491,6 @@ __metadata:
languageName: node
linkType: hard

"discord-api-types@npm:^0.37.50":
version: 0.37.52
resolution: "discord-api-types@npm:0.37.52"
checksum: 10/c9212437192cbd782441bc1da7c8caf4114ada6241fd9673eda70df6f8b3003acf3fbe9c59d5be22cf9bb941ac5c3f234895be79f1476f9a1ce0096e2d52367e
languageName: node
linkType: hard

"discord-player@workspace:^, discord-player@workspace:packages/discord-player":
version: 0.0.0-use.local
resolution: "discord-player@workspace:packages/discord-player"
Expand All @@ -6525,11 +6504,12 @@ __metadata:
"@types/ws": "npm:^8.5.3"
"@web-scrobbler/metadata-filter": "npm:^3.1.0"
discord-api-types: "npm:^0.37.0"
discord-voip: "npm:^0.1.3"
discord-voip: "workspace:^"
discord.js: "npm:^14.15.3"
eris: "npm:^0.17.2"
libsodium-wrappers: "npm:^0.7.13"
opusscript: "npm:^0.0.8"
prism-media: "npm:^1.3.5"
tsup: "npm:^7.2.0"
typescript: "npm:^5.2.2"
vitest: "npm:^0.34.6"
Expand All @@ -6538,22 +6518,7 @@ __metadata:
languageName: unknown
linkType: soft

"discord-voip@npm:^0.1.3":
version: 0.1.3
resolution: "discord-voip@npm:0.1.3"
dependencies:
"@discord-player/ffmpeg": "npm:^0.1.0"
"@discord-player/opus": "npm:^0.1.2"
"@types/ws": "npm:^8.5.5"
discord-api-types: "npm:^0.37.50"
prism-media: "npm:^1.3.5"
tslib: "npm:^2.6.1"
ws: "npm:^8.13.0"
checksum: 10/640db80b7ceb5be392b30d3f801fa9eaa2207204eaaa04fd265404f26d17fad4d7976de9c3d14a6c525b8bf23a3b69ac307300230e01bdd5f4689e3740961426
languageName: node
linkType: hard

"discord-voip@workspace:packages/discord-voip":
"discord-voip@workspace:^, discord-voip@workspace:packages/discord-voip":
version: 0.0.0-use.local
resolution: "discord-voip@workspace:packages/discord-voip"
dependencies:
Expand Down Expand Up @@ -15134,13 +15099,6 @@ __metadata:
languageName: node
linkType: hard

"tslib@npm:^2.6.1":
version: 2.6.1
resolution: "tslib@npm:2.6.1"
checksum: 10/5cf1aa7ea4ca7ee9b8aa3d80eb7ee86634b307fbefcb948a831c2b13728e21e156ef7fb9edcbe21f05c08f65e4cf4480587086f31133491ba1a49c9e0b28fc75
languageName: node
linkType: hard

"tslib@npm:^2.6.2":
version: 2.6.3
resolution: "tslib@npm:2.6.3"
Expand Down Expand Up @@ -16382,21 +16340,6 @@ __metadata:
languageName: node
linkType: hard

"ws@npm:^8.13.0":
version: 8.13.0
resolution: "ws@npm:8.13.0"
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: ">=5.0.2"
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
checksum: 10/1769532b6fdab9ff659f0b17810e7501831d34ecca23fd179ee64091dd93a51f42c59f6c7bb4c7a384b6c229aca8076fb312aa35626257c18081511ef62a161d
languageName: node
linkType: hard

"ws@npm:^8.16.0, ws@npm:^8.2.3":
version: 8.18.0
resolution: "ws@npm:8.18.0"
Expand Down

0 comments on commit 853f44b

Please sign in to comment.