changed structure; improve
type accuracy;
This commit is contained in:
+4
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-audio-stream",
|
||||
"version": "0.6.10",
|
||||
"version": "0.6.11",
|
||||
"description": "NodeJS library to make stream any audio on discord easier.",
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -20,6 +20,9 @@
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"directories": {
|
||||
"lib": "src"
|
||||
},
|
||||
"scripts": {
|
||||
"updateDependencies": "npx npm-check-updates --upgrade && npm install && echo SUCCEED UPDATE",
|
||||
"cleanSolution": "del-cli dist && echo SUCCEED CLEAN",
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import type VoiceConnectionDataModel from "../Models/VoiceConnectionDataModel";
|
||||
import type VoiceAudioDataModel from "../Models/VoiceAudioDataModel";
|
||||
|
||||
export default interface IAudioManager {
|
||||
OverrideOptions(connectionData?: VoiceConnectionDataModel | null, audioData?: VoiceAudioDataModel | null): void;
|
||||
|
||||
CreateConnection(isRenew: boolean): void;
|
||||
|
||||
PlayAudioOnConnection(): void;
|
||||
|
||||
PauseAudio(): void;
|
||||
|
||||
ResumeAudio(): void;
|
||||
|
||||
StopAudioOnConnection(): void;
|
||||
|
||||
CreateConnectionAndPlayAudio(): void;
|
||||
|
||||
DestroyConnection(resetValidationParameters: boolean): void;
|
||||
|
||||
SetVolume(volumeInPercent: number): void;
|
||||
|
||||
SetMaxListeners(maxListeners: number): void;
|
||||
}
|
||||
@@ -6,12 +6,11 @@ import {
|
||||
joinVoiceChannel,
|
||||
VoiceConnection
|
||||
} from "@discordjs/voice";
|
||||
import type IAudioManager from "./IAudioManager";
|
||||
import type VoiceConnectionDataModel from "../Models/VoiceConnectionDataModel";
|
||||
import type VoiceAudioDataModel from "../Models/VoiceAudioDataModel";
|
||||
import {join} from "node:path";
|
||||
import {VoiceConnectionDataModel} from "./types/VoiceConnectionDataModel";
|
||||
import {VoiceAudioDataModel} from "./types/VoiceAudioDataModel";
|
||||
|
||||
export default class AudioManager implements IAudioManager {
|
||||
export default class AudioManager {
|
||||
public VoiceConnection: VoiceConnection | null = null;
|
||||
public AudioPlayer: AudioPlayer | null = null;
|
||||
public AudioResource: AudioResource | null = null;
|
||||
+3
-3
@@ -1,3 +1,3 @@
|
||||
export { default as AudioManager } from './Services/AudioManager';
|
||||
export type { default as VoiceConnectionDataModel } from './Models/VoiceConnectionDataModel';
|
||||
export type { default as VoiceAudioDataModel } from './Models/VoiceAudioDataModel';
|
||||
export {default as AudioManager} from './audioManager';
|
||||
export type {VoiceConnectionDataModel} from './types/VoiceConnectionDataModel';
|
||||
export type {VoiceAudioDataModel} from './types/VoiceAudioDataModel';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default interface VoiceAudioDataModel {
|
||||
export type VoiceAudioDataModel = {
|
||||
/**
|
||||
* The unique identifier for the audio resource.
|
||||
*/
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
import type {DiscordGatewayAdapterCreator} from "@discordjs/voice";
|
||||
|
||||
export default interface VoiceConnectionDataModel {
|
||||
export type VoiceConnectionDataModel = {
|
||||
/**
|
||||
* The ID of the voice channel to connect to.
|
||||
*/
|
||||
VoiceChannelId: number;
|
||||
VoiceChannelId: string;
|
||||
|
||||
/**
|
||||
* The Id of the guild (server) to connect to.
|
||||
*/
|
||||
GuildId: number;
|
||||
GuildId: string;
|
||||
|
||||
/**
|
||||
* The adapter creator for the voice connection.
|
||||
Reference in New Issue
Block a user