discord-player 6.6.9-dev.1 → 6.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/index.d.ts +90 -39
- package/dist/index.js +157 -69
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ Discord Player is a robust framework for developing Discord Music bots using Jav
|
|
|
24
24
|
- Offers easy debugging methods
|
|
25
25
|
- Out-of-the-box voice states handling
|
|
26
26
|
- IP Rotation support
|
|
27
|
+
- Easy serialization and deserialization
|
|
27
28
|
|
|
28
29
|
## Installation
|
|
29
30
|
|
|
@@ -117,7 +118,7 @@ const client = new Discord.Client({
|
|
|
117
118
|
// this is the entrypoint for discord-player based application
|
|
118
119
|
const player = new Player(client);
|
|
119
120
|
|
|
120
|
-
// Now, lets load all the default extractors, except 'YouTubeExtractor'. You can remove the filter if you want to
|
|
121
|
+
// Now, lets load all the default extractors, except 'YouTubeExtractor'. You can remove the filter if you want to include youtube.
|
|
121
122
|
await player.extractors.loadDefault((ext) => ext !== 'YouTubeExtractor');
|
|
122
123
|
```
|
|
123
124
|
|
|
@@ -127,7 +128,7 @@ Discord Player is mostly events based. It emits different events based on the co
|
|
|
127
128
|
// this event is emitted whenever discord-player starts to play a track
|
|
128
129
|
player.events.on('playerStart', (queue, track) => {
|
|
129
130
|
// we will later define queue.metadata object while creating the queue
|
|
130
|
-
queue.metadata.channel.send(`Started playing **${track.
|
|
131
|
+
queue.metadata.channel.send(`Started playing **${track.cleanTitle}**!`);
|
|
131
132
|
});
|
|
132
133
|
```
|
|
133
134
|
|
|
@@ -153,7 +154,7 @@ export async function execute(interaction) {
|
|
|
153
154
|
}
|
|
154
155
|
});
|
|
155
156
|
|
|
156
|
-
return interaction.followUp(`**${track.
|
|
157
|
+
return interaction.followUp(`**${track.cleanTitle}** enqueued!`);
|
|
157
158
|
} catch (e) {
|
|
158
159
|
// let's return error if something failed
|
|
159
160
|
return interaction.followUp(`Something went wrong: ${e}`);
|
package/dist/index.d.ts
CHANGED
|
@@ -585,7 +585,7 @@ declare class FFmpegFilterer<Meta = unknown> {
|
|
|
585
585
|
* Set ffmpeg filters
|
|
586
586
|
* @param filters The filters
|
|
587
587
|
*/
|
|
588
|
-
setFilters(filters: Filters[] | Record<Filters, boolean> | boolean): Promise<boolean>;
|
|
588
|
+
setFilters(filters: Filters[] | Record<Filters, boolean> | string[] | boolean): Promise<boolean>;
|
|
589
589
|
/**
|
|
590
590
|
* Currently active ffmpeg filters
|
|
591
591
|
*/
|
|
@@ -969,119 +969,149 @@ declare const GuildQueueEvent: {
|
|
|
969
969
|
* Emitted when audio track is added to the queue
|
|
970
970
|
*/
|
|
971
971
|
readonly audioTrackAdd: "audioTrackAdd";
|
|
972
|
+
readonly AudioTrackAdd: "audioTrackAdd";
|
|
972
973
|
/**
|
|
973
974
|
* Emitted when audio tracks were added to the queue
|
|
974
975
|
*/
|
|
975
976
|
readonly audioTracksAdd: "audioTracksAdd";
|
|
977
|
+
readonly AudioTracksAdd: "audioTracksAdd";
|
|
976
978
|
/**
|
|
977
979
|
* Emitted when audio track is removed from the queue
|
|
978
980
|
*/
|
|
979
981
|
readonly audioTrackRemove: "audioTrackRemove";
|
|
982
|
+
readonly AudioTrackRemove: "audioTrackRemove";
|
|
980
983
|
/**
|
|
981
984
|
* Emitted when audio tracks are removed from the queue
|
|
982
985
|
*/
|
|
983
986
|
readonly audioTracksRemove: "audioTracksRemove";
|
|
987
|
+
readonly AudioTracksRemove: "audioTracksRemove";
|
|
984
988
|
/**
|
|
985
989
|
* Emitted when a connection is created
|
|
986
990
|
*/
|
|
987
991
|
readonly connection: "connection";
|
|
992
|
+
readonly Connection: "connection";
|
|
988
993
|
/**
|
|
989
994
|
* Emitted when a voice connection is destroyed
|
|
990
995
|
*/
|
|
991
996
|
readonly connectionDestroyed: "connectionDestroyed";
|
|
997
|
+
readonly ConnectionDestroyed: "connectionDestroyed";
|
|
992
998
|
/**
|
|
993
999
|
* Emitted when the bot is disconnected from the channel
|
|
994
1000
|
*/
|
|
995
1001
|
readonly disconnect: "disconnect";
|
|
1002
|
+
readonly Disconnect: "disconnect";
|
|
996
1003
|
/**
|
|
997
1004
|
* Emitted when the queue sends a debug info
|
|
998
1005
|
*/
|
|
999
1006
|
readonly debug: "debug";
|
|
1007
|
+
readonly Debug: "debug";
|
|
1000
1008
|
/**
|
|
1001
1009
|
* Emitted when the queue encounters error
|
|
1002
1010
|
*/
|
|
1003
1011
|
readonly error: "error";
|
|
1012
|
+
readonly Error: "error";
|
|
1004
1013
|
/**
|
|
1005
1014
|
* Emitted when the voice channel is empty
|
|
1006
1015
|
*/
|
|
1007
1016
|
readonly emptyChannel: "emptyChannel";
|
|
1017
|
+
readonly EmptyChannel: "emptyChannel";
|
|
1008
1018
|
/**
|
|
1009
1019
|
* Emitted when the queue is empty
|
|
1010
1020
|
*/
|
|
1011
1021
|
readonly emptyQueue: "emptyQueue";
|
|
1022
|
+
readonly EmptyQueue: "emptyQueue";
|
|
1012
1023
|
/**
|
|
1013
1024
|
* Emitted when the audio player starts streaming audio track
|
|
1014
1025
|
*/
|
|
1015
1026
|
readonly playerStart: "playerStart";
|
|
1027
|
+
readonly PlayerStart: "playerStart";
|
|
1016
1028
|
/**
|
|
1017
1029
|
* Emitted when the audio player errors while streaming audio track
|
|
1018
1030
|
*/
|
|
1019
1031
|
readonly playerError: "playerError";
|
|
1032
|
+
readonly PlayerError: "playerError";
|
|
1020
1033
|
/**
|
|
1021
1034
|
* Emitted when the audio player finishes streaming audio track
|
|
1022
1035
|
*/
|
|
1023
1036
|
readonly playerFinish: "playerFinish";
|
|
1037
|
+
readonly PlayerFinish: "playerFinish";
|
|
1024
1038
|
/**
|
|
1025
1039
|
* Emitted when the audio player skips current track
|
|
1026
1040
|
*/
|
|
1027
1041
|
readonly playerSkip: "playerSkip";
|
|
1042
|
+
readonly PlayerSkip: "playerSkip";
|
|
1028
1043
|
/**
|
|
1029
1044
|
* Emitted when the audio player is triggered
|
|
1030
1045
|
*/
|
|
1031
1046
|
readonly playerTrigger: "playerTrigger";
|
|
1047
|
+
readonly PlayerTrigger: "playerTrigger";
|
|
1032
1048
|
/**
|
|
1033
1049
|
* Emitted when the voice state is updated. Consuming this event may disable default voice state update handler if `Player.isVoiceStateHandlerLocked()` returns `false`.
|
|
1034
1050
|
*/
|
|
1035
1051
|
readonly voiceStateUpdate: "voiceStateUpdate";
|
|
1052
|
+
readonly VoiceStateUpdate: "voiceStateUpdate";
|
|
1036
1053
|
/**
|
|
1037
1054
|
* Emitted when volume is updated
|
|
1038
1055
|
*/
|
|
1039
1056
|
readonly volumeChange: "volumeChange";
|
|
1057
|
+
readonly VolumeChange: "volumeChange";
|
|
1040
1058
|
/**
|
|
1041
1059
|
* Emitted when player is paused
|
|
1042
1060
|
*/
|
|
1043
1061
|
readonly playerPause: "playerPause";
|
|
1062
|
+
readonly PlayerPause: "playerPause";
|
|
1044
1063
|
/**
|
|
1045
1064
|
* Emitted when player is resumed
|
|
1046
1065
|
*/
|
|
1047
1066
|
readonly playerResume: "playerResume";
|
|
1067
|
+
readonly PlayerResume: "playerResume";
|
|
1048
1068
|
/**
|
|
1049
1069
|
* Biquad Filters Update
|
|
1050
1070
|
*/
|
|
1051
1071
|
readonly biquadFiltersUpdate: "biquadFiltersUpdate";
|
|
1072
|
+
readonly BiquadFiltersUpdate: "biquadFiltersUpdate";
|
|
1052
1073
|
/**
|
|
1053
1074
|
* Equalizer Update
|
|
1054
1075
|
*/
|
|
1055
1076
|
readonly equalizerUpdate: "equalizerUpdate";
|
|
1077
|
+
readonly EqualizerUpdate: "equalizerUpdate";
|
|
1056
1078
|
/**
|
|
1057
1079
|
* DSP update
|
|
1058
1080
|
*/
|
|
1059
1081
|
readonly dspUpdate: "dspUpdate";
|
|
1082
|
+
readonly DSPUpdate: "dspUpdate";
|
|
1060
1083
|
/**
|
|
1061
1084
|
* Audio Filters Update
|
|
1062
1085
|
*/
|
|
1063
1086
|
readonly audioFiltersUpdate: "audioFiltersUpdate";
|
|
1087
|
+
readonly AudioFiltersUpdate: "audioFiltersUpdate";
|
|
1064
1088
|
/**
|
|
1065
1089
|
* Audio player will play next track
|
|
1066
1090
|
*/
|
|
1067
1091
|
readonly willPlayTrack: "willPlayTrack";
|
|
1092
|
+
readonly WillPlayTrack: "willPlayTrack";
|
|
1068
1093
|
/**
|
|
1069
1094
|
* Emitted when a voice channel is repopulated
|
|
1070
1095
|
*/
|
|
1071
1096
|
readonly channelPopulate: "channelPopulate";
|
|
1097
|
+
readonly ChannelPopulate: "channelPopulate";
|
|
1072
1098
|
/**
|
|
1073
1099
|
* Emitted when a queue is successfully created
|
|
1074
1100
|
*/
|
|
1075
1101
|
readonly queueCreate: "queueCreate";
|
|
1102
|
+
readonly QueueCreate: "queueCreate";
|
|
1076
1103
|
/**
|
|
1077
1104
|
* Emitted when a queue is deleted
|
|
1078
1105
|
*/
|
|
1079
1106
|
readonly queueDelete: "queueDelete";
|
|
1107
|
+
readonly QueueDelete: "queueDelete";
|
|
1080
1108
|
/**
|
|
1081
1109
|
* Emitted when a queue is trying to add similar track for autoplay
|
|
1082
1110
|
*/
|
|
1083
1111
|
readonly willAutoPlay: "willAutoPlay";
|
|
1112
|
+
readonly WillAutoPlay: "willAutoPlay";
|
|
1084
1113
|
};
|
|
1114
|
+
type GuildQueueEvent = (typeof GuildQueueEvent)[keyof typeof GuildQueueEvent];
|
|
1085
1115
|
declare enum TrackSkipReason {
|
|
1086
1116
|
NoStream = "ERR_NO_STREAM",
|
|
1087
1117
|
Manual = "MANUAL",
|
|
@@ -1096,81 +1126,81 @@ interface GuildQueueEvents<Meta = any> {
|
|
|
1096
1126
|
* @param queue The queue where this event occurred
|
|
1097
1127
|
* @param track The track
|
|
1098
1128
|
*/
|
|
1099
|
-
|
|
1129
|
+
[GuildQueueEvent.AudioTrackAdd]: (queue: GuildQueue<Meta>, track: Track) => unknown;
|
|
1100
1130
|
/**
|
|
1101
1131
|
* Emitted when audio tracks were added to the queue
|
|
1102
1132
|
* @param queue The queue where this event occurred
|
|
1103
1133
|
* @param tracks The tracks array
|
|
1104
1134
|
*/
|
|
1105
|
-
|
|
1135
|
+
[GuildQueueEvent.AudioTracksAdd]: (queue: GuildQueue<Meta>, track: Track[]) => unknown;
|
|
1106
1136
|
/**
|
|
1107
1137
|
* Emitted when audio track is removed from the queue
|
|
1108
1138
|
* @param queue The queue where this event occurred
|
|
1109
1139
|
* @param track The track
|
|
1110
1140
|
*/
|
|
1111
|
-
|
|
1141
|
+
[GuildQueueEvent.AudioTrackRemove]: (queue: GuildQueue<Meta>, track: Track) => unknown;
|
|
1112
1142
|
/**
|
|
1113
1143
|
* Emitted when audio tracks are removed from the queue
|
|
1114
1144
|
* @param queue The queue where this event occurred
|
|
1115
1145
|
* @param track The track
|
|
1116
1146
|
*/
|
|
1117
|
-
|
|
1147
|
+
[GuildQueueEvent.AudioTracksRemove]: (queue: GuildQueue<Meta>, track: Track[]) => unknown;
|
|
1118
1148
|
/**
|
|
1119
1149
|
* Emitted when a connection is created
|
|
1120
1150
|
* @param queue The queue where this event occurred
|
|
1121
1151
|
*/
|
|
1122
|
-
|
|
1152
|
+
[GuildQueueEvent.Connection]: (queue: GuildQueue<Meta>) => unknown;
|
|
1123
1153
|
/**
|
|
1124
1154
|
* Emitted when a connection is destroyed
|
|
1125
1155
|
* @param queue The queue where this event occurred
|
|
1126
1156
|
*/
|
|
1127
|
-
|
|
1157
|
+
[GuildQueueEvent.ConnectionDestroyed]: (queue: GuildQueue<Meta>) => unknown;
|
|
1128
1158
|
/**
|
|
1129
1159
|
* Emitted when the bot is disconnected from the channel
|
|
1130
1160
|
* @param queue The queue where this event occurred
|
|
1131
1161
|
*/
|
|
1132
|
-
|
|
1162
|
+
[GuildQueueEvent.Disconnect]: (queue: GuildQueue<Meta>) => unknown;
|
|
1133
1163
|
/**
|
|
1134
1164
|
* Emitted when the queue sends a debug info
|
|
1135
1165
|
* @param queue The queue where this event occurred
|
|
1136
1166
|
* @param message The debug message
|
|
1137
1167
|
*/
|
|
1138
|
-
|
|
1168
|
+
[GuildQueueEvent.Debug]: (queue: GuildQueue<Meta>, message: string) => unknown;
|
|
1139
1169
|
/**
|
|
1140
1170
|
* Emitted when the queue encounters error
|
|
1141
1171
|
* @param queue The queue where this event occurred
|
|
1142
1172
|
* @param error The error
|
|
1143
1173
|
*/
|
|
1144
|
-
|
|
1174
|
+
[GuildQueueEvent.Error]: (queue: GuildQueue<Meta>, error: Error) => unknown;
|
|
1145
1175
|
/**
|
|
1146
1176
|
* Emitted when the voice channel is empty
|
|
1147
1177
|
* @param queue The queue where this event occurred
|
|
1148
1178
|
*/
|
|
1149
|
-
|
|
1179
|
+
[GuildQueueEvent.EmptyChannel]: (queue: GuildQueue<Meta>) => unknown;
|
|
1150
1180
|
/**
|
|
1151
1181
|
* Emitted when the queue is empty
|
|
1152
1182
|
* @param queue The queue where this event occurred
|
|
1153
1183
|
*/
|
|
1154
|
-
|
|
1184
|
+
[GuildQueueEvent.EmptyQueue]: (queue: GuildQueue<Meta>) => unknown;
|
|
1155
1185
|
/**
|
|
1156
1186
|
* Emitted when the audio player starts streaming audio track
|
|
1157
1187
|
* @param queue The queue where this event occurred
|
|
1158
1188
|
* @param track The track that is being streamed
|
|
1159
1189
|
*/
|
|
1160
|
-
|
|
1190
|
+
[GuildQueueEvent.PlayerStart]: (queue: GuildQueue<Meta>, track: Track) => unknown;
|
|
1161
1191
|
/**
|
|
1162
1192
|
* Emitted when the audio player errors while streaming audio track
|
|
1163
1193
|
* @param queue The queue where this event occurred
|
|
1164
1194
|
* @param error The error
|
|
1165
1195
|
* @param track The track that is being streamed
|
|
1166
1196
|
*/
|
|
1167
|
-
|
|
1197
|
+
[GuildQueueEvent.PlayerError]: (queue: GuildQueue<Meta>, error: Error, track: Track) => unknown;
|
|
1168
1198
|
/**
|
|
1169
1199
|
* Emitted when the audio player finishes streaming audio track
|
|
1170
1200
|
* @param queue The queue where this event occurred
|
|
1171
1201
|
* @param track The track that was being streamed
|
|
1172
1202
|
*/
|
|
1173
|
-
|
|
1203
|
+
[GuildQueueEvent.PlayerFinish]: (queue: GuildQueue<Meta>, track: Track) => unknown;
|
|
1174
1204
|
/**
|
|
1175
1205
|
* Emitted when the audio player skips current track
|
|
1176
1206
|
* @param queue The queue where this event occurred
|
|
@@ -1178,65 +1208,65 @@ interface GuildQueueEvents<Meta = any> {
|
|
|
1178
1208
|
* @param reason The reason for skipping
|
|
1179
1209
|
* @param description The description for skipping
|
|
1180
1210
|
*/
|
|
1181
|
-
|
|
1211
|
+
[GuildQueueEvent.PlayerSkip]: (queue: GuildQueue<Meta>, track: Track, reason: TrackSkipReason, description: string) => unknown;
|
|
1182
1212
|
/**
|
|
1183
1213
|
* Emitted when the audio player is triggered
|
|
1184
1214
|
* @param queue The queue where this event occurred
|
|
1185
1215
|
* @param track The track which was played in this event
|
|
1186
1216
|
*/
|
|
1187
|
-
|
|
1217
|
+
[GuildQueueEvent.PlayerTrigger]: (queue: GuildQueue<Meta>, track: Track, reason: PlayerTriggeredReason) => unknown;
|
|
1188
1218
|
/**
|
|
1189
1219
|
* Emitted when the voice state is updated. Consuming this event may disable default voice state update handler if `Player.isVoiceStateHandlerLocked()` returns `false`.
|
|
1190
1220
|
* @param queue The queue where this event occurred
|
|
1191
1221
|
* @param oldState The old voice state
|
|
1192
1222
|
* @param newState The new voice state
|
|
1193
1223
|
*/
|
|
1194
|
-
|
|
1224
|
+
[GuildQueueEvent.VoiceStateUpdate]: (queue: GuildQueue<Meta>, oldState: VoiceState, newState: VoiceState) => unknown;
|
|
1195
1225
|
/**
|
|
1196
1226
|
* Emitted when audio player is paused
|
|
1197
1227
|
* @param queue The queue where this event occurred
|
|
1198
1228
|
*/
|
|
1199
|
-
|
|
1229
|
+
[GuildQueueEvent.PlayerPause]: (queue: GuildQueue<Meta>) => unknown;
|
|
1200
1230
|
/**
|
|
1201
1231
|
* Emitted when audio player is resumed
|
|
1202
1232
|
* @param queue The queue where this event occurred
|
|
1203
1233
|
*/
|
|
1204
|
-
|
|
1234
|
+
[GuildQueueEvent.PlayerResume]: (queue: GuildQueue<Meta>) => unknown;
|
|
1205
1235
|
/**
|
|
1206
1236
|
* Emitted when audio player's volume is changed
|
|
1207
1237
|
* @param queue The queue where this event occurred
|
|
1208
1238
|
* @param oldVolume The old volume
|
|
1209
1239
|
* @param newVolume The updated volume
|
|
1210
1240
|
*/
|
|
1211
|
-
|
|
1241
|
+
[GuildQueueEvent.VolumeChange]: (queue: GuildQueue<Meta>, oldVolume: number, newVolume: number) => unknown;
|
|
1212
1242
|
/**
|
|
1213
1243
|
* Emitted when equalizer config is updated
|
|
1214
1244
|
* @param queue The queue where this event occurred
|
|
1215
1245
|
* @param oldFilters Old filters
|
|
1216
1246
|
* @param newFilters New filters
|
|
1217
1247
|
*/
|
|
1218
|
-
|
|
1248
|
+
[GuildQueueEvent.EqualizerUpdate]: (queue: GuildQueue<Meta>, oldFilters: EqualizerBand[], newFilters: EqualizerBand[]) => unknown;
|
|
1219
1249
|
/**
|
|
1220
1250
|
* Emitted when biquad filters is updated
|
|
1221
1251
|
* @param queue The queue where this event occurred
|
|
1222
1252
|
* @param oldFilters Old filters
|
|
1223
1253
|
* @param newFilters New filters
|
|
1224
1254
|
*/
|
|
1225
|
-
|
|
1255
|
+
[GuildQueueEvent.BiquadFiltersUpdate]: (queue: GuildQueue<Meta>, oldFilters: BiquadFilters | null, newFilters: BiquadFilters | null) => unknown;
|
|
1226
1256
|
/**
|
|
1227
1257
|
* Emitted when dsp filters is updated
|
|
1228
1258
|
* @param queue The queue where this event occurred
|
|
1229
1259
|
* @param oldFilters Old filters
|
|
1230
1260
|
* @param newFilters New filters
|
|
1231
1261
|
*/
|
|
1232
|
-
|
|
1262
|
+
[GuildQueueEvent.DSPUpdate]: (queue: GuildQueue<Meta>, oldFilters: PCMFilters[], newFilters: PCMFilters[]) => unknown;
|
|
1233
1263
|
/**
|
|
1234
1264
|
* Emitted when ffmpeg audio filters is updated
|
|
1235
1265
|
* @param queue The queue where this event occurred
|
|
1236
1266
|
* @param oldFilters Old filters
|
|
1237
1267
|
* @param newFilters New filters
|
|
1238
1268
|
*/
|
|
1239
|
-
|
|
1269
|
+
[GuildQueueEvent.AudioFiltersUpdate]: (queue: GuildQueue<Meta>, oldFilters: FiltersName[], newFilters: FiltersName[]) => unknown;
|
|
1240
1270
|
/**
|
|
1241
1271
|
* Emitted before streaming an audio track. This event can be used to modify stream config before playing a track.
|
|
1242
1272
|
* Listening to this event will pause the execution of audio player until `done()` is invoked.
|
|
@@ -1245,29 +1275,29 @@ interface GuildQueueEvents<Meta = any> {
|
|
|
1245
1275
|
* @param config Configurations for streaming
|
|
1246
1276
|
* @param done Done callback
|
|
1247
1277
|
*/
|
|
1248
|
-
|
|
1278
|
+
[GuildQueueEvent.WillPlayTrack]: (queue: GuildQueue<Meta>, track: Track<unknown>, config: StreamConfig, done: () => void) => unknown;
|
|
1249
1279
|
/**
|
|
1250
1280
|
* Emitted when a voice channel is populated
|
|
1251
1281
|
* @param queue The queue where this event occurred
|
|
1252
1282
|
*/
|
|
1253
|
-
|
|
1283
|
+
[GuildQueueEvent.ChannelPopulate]: (queue: GuildQueue<Meta>) => unknown;
|
|
1254
1284
|
/**
|
|
1255
1285
|
* Emitted when a queue is successfully created
|
|
1256
1286
|
* @param queue The queue where this event occurred
|
|
1257
1287
|
*/
|
|
1258
|
-
|
|
1288
|
+
[GuildQueueEvent.QueueCreate]: (queue: GuildQueue<Meta>) => unknown;
|
|
1259
1289
|
/**
|
|
1260
1290
|
* Emitted when a queue is successfully deleted
|
|
1261
1291
|
* @param queue The queue where this event occurred
|
|
1262
1292
|
*/
|
|
1263
|
-
|
|
1293
|
+
[GuildQueueEvent.QueueDelete]: (queue: GuildQueue<Meta>) => unknown;
|
|
1264
1294
|
/**
|
|
1265
1295
|
* Emitted when a queue is trying to add similar track for autoplay
|
|
1266
1296
|
* @param queue The queue where this event occurred
|
|
1267
1297
|
* @param tracks The similar tracks that were found
|
|
1268
1298
|
* @param done Done callback
|
|
1269
1299
|
*/
|
|
1270
|
-
|
|
1300
|
+
[GuildQueueEvent.WillAutoPlay]: (queue: GuildQueue<Meta>, tracks: Track[], done: (track: Track | null) => void) => unknown;
|
|
1271
1301
|
}
|
|
1272
1302
|
declare class GuildQueue<Meta = unknown> {
|
|
1273
1303
|
#private;
|
|
@@ -1561,6 +1591,7 @@ declare class Track<T = unknown> {
|
|
|
1561
1591
|
readonly id: string;
|
|
1562
1592
|
private __metadata;
|
|
1563
1593
|
private __reqMetadataFn;
|
|
1594
|
+
cleanTitle: string;
|
|
1564
1595
|
/**
|
|
1565
1596
|
* Track constructor
|
|
1566
1597
|
* @param player The player that instantiated this Track
|
|
@@ -1690,13 +1721,13 @@ declare class Playlist {
|
|
|
1690
1721
|
title: string;
|
|
1691
1722
|
description: string;
|
|
1692
1723
|
author: string;
|
|
1693
|
-
url: string;
|
|
1694
|
-
thumbnail: any;
|
|
1695
|
-
duration: string; /**
|
|
1724
|
+
url: string; /**
|
|
1696
1725
|
* Play this playlist to the given voice channel. If queue exists and another track is being played, this playlist will be added to the queue.
|
|
1697
1726
|
* @param channel Voice channel on which this playlist shall be played
|
|
1698
1727
|
* @param options Node initialization options
|
|
1699
1728
|
*/
|
|
1729
|
+
thumbnail: any;
|
|
1730
|
+
duration: string;
|
|
1700
1731
|
views: number;
|
|
1701
1732
|
requested_by: {} | null;
|
|
1702
1733
|
source: TrackSource;
|
|
@@ -2707,6 +2738,10 @@ interface RawTrackData {
|
|
|
2707
2738
|
* The query type
|
|
2708
2739
|
*/
|
|
2709
2740
|
queryType?: SearchQueryType;
|
|
2741
|
+
/**
|
|
2742
|
+
* The seralised title
|
|
2743
|
+
*/
|
|
2744
|
+
cleanTitle?: string;
|
|
2710
2745
|
}
|
|
2711
2746
|
interface TimeData {
|
|
2712
2747
|
/**
|
|
@@ -2815,11 +2850,15 @@ interface PlayerEvents {
|
|
|
2815
2850
|
error: (error: Error) => any;
|
|
2816
2851
|
voiceStateUpdate: (queue: GuildQueue, oldState: VoiceState, newState: VoiceState) => any;
|
|
2817
2852
|
}
|
|
2818
|
-
declare
|
|
2819
|
-
debug
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2853
|
+
declare const PlayerEvent: {
|
|
2854
|
+
readonly debug: "debug";
|
|
2855
|
+
readonly Debug: "debug";
|
|
2856
|
+
readonly error: "error";
|
|
2857
|
+
readonly Error: "error";
|
|
2858
|
+
readonly voiceStateUpdate: "voiceStateUpdate";
|
|
2859
|
+
readonly VoiceStateUpdate: "voiceStateUpdate";
|
|
2860
|
+
};
|
|
2861
|
+
type PlayerEvent = (typeof PlayerEvent)[keyof typeof PlayerEvent];
|
|
2823
2862
|
interface PlayOptions {
|
|
2824
2863
|
/**
|
|
2825
2864
|
* If this play was triggered for filters update
|
|
@@ -3106,7 +3145,7 @@ declare class AudioFilters {
|
|
|
3106
3145
|
* @param filter The filter name
|
|
3107
3146
|
* @returns
|
|
3108
3147
|
*/
|
|
3109
|
-
static create<K extends FiltersName>(filters?: K[]): string;
|
|
3148
|
+
static create<K extends FiltersName>(filters?: (K | string)[]): string;
|
|
3110
3149
|
/**
|
|
3111
3150
|
* Defines audio filter
|
|
3112
3151
|
* @param filterName The name of the filter
|
|
@@ -3155,6 +3194,11 @@ declare class Util {
|
|
|
3155
3194
|
* @returns {string}
|
|
3156
3195
|
*/
|
|
3157
3196
|
static buildTimeCode(duration: TimeData): string;
|
|
3197
|
+
/**
|
|
3198
|
+
* Formats duration
|
|
3199
|
+
* @param {number} duration The duration in ms
|
|
3200
|
+
*/
|
|
3201
|
+
static formatDuration(duration: number): string;
|
|
3158
3202
|
/**
|
|
3159
3203
|
* Picks last item of the given array
|
|
3160
3204
|
* @param {any[]} arr The array
|
|
@@ -3167,6 +3211,13 @@ declare class Util {
|
|
|
3167
3211
|
* @returns {boolean}
|
|
3168
3212
|
*/
|
|
3169
3213
|
static isVoiceEmpty(channel: VoiceChannel | StageChannel): boolean;
|
|
3214
|
+
/**
|
|
3215
|
+
* Cleans the track title
|
|
3216
|
+
* @param title The title
|
|
3217
|
+
* @param source The source
|
|
3218
|
+
* @returns Cleaned title
|
|
3219
|
+
*/
|
|
3220
|
+
static cleanTitle(title: string, source: TrackSource): string;
|
|
3170
3221
|
/**
|
|
3171
3222
|
* Safer require
|
|
3172
3223
|
* @param {string} id Node require id
|