-
-
Notifications
You must be signed in to change notification settings - Fork 94
/
DisTubeBase.ts
63 lines (62 loc) · 1.32 KB
/
DisTubeBase.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import type { Client, GuildTextBasedChannel } from "discord.js";
import type { DisTube, DisTubeEvents, DisTubeHandler, DisTubeVoiceManager, Options, QueueManager } from "..";
/**
* @virtual
*/
export abstract class DisTubeBase {
distube: DisTube;
constructor(distube: DisTube) {
/**
* DisTube
*/
this.distube = distube;
}
/**
* Emit the {@link DisTube} of this base
*
* @param eventName - Event name
* @param args - arguments
*/
emit(eventName: keyof DisTubeEvents, ...args: any): boolean {
return this.distube.emit(eventName, ...args);
}
/**
* Emit error event
*
* @param error - error
* @param channel - Text channel where the error is encountered.
*/
emitError(error: Error, channel?: GuildTextBasedChannel) {
this.distube.emitError(error, channel);
}
/**
* The queue manager
*/
get queues(): QueueManager {
return this.distube.queues;
}
/**
* The voice manager
*/
get voices(): DisTubeVoiceManager {
return this.distube.voices;
}
/**
* Discord.js client
*/
get client(): Client {
return this.distube.client;
}
/**
* DisTube options
*/
get options(): Options {
return this.distube.options;
}
/**
* DisTube handler
*/
get handler(): DisTubeHandler {
return this.distube.handler;
}
}