aqualink 2.18.1 → 2.19.1
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/build/handlers/autoplay.js +148 -121
- package/build/handlers/fetchImage.js +152 -148
- package/build/index.d.ts +1401 -1080
- package/build/index.js +23 -12
- package/build/structures/Aqua.js +1085 -896
- package/build/structures/AqualinkEvents.js +43 -45
- package/build/structures/Connection.js +576 -483
- package/build/structures/Filters.js +351 -244
- package/build/structures/Node.js +666 -548
- package/build/structures/Player.js +1143 -904
- package/build/structures/Plugins.js +10 -11
- package/build/structures/Queue.js +129 -111
- package/build/structures/Rest.js +856 -645
- package/build/structures/Track.js +158 -129
- package/package.json +1 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
module.exports = Plugin
|
|
1
|
+
class Plugin {
|
|
2
|
+
constructor(name) {
|
|
3
|
+
this.name = name
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
load(aqua) {}
|
|
7
|
+
unload(aqua) {}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
module.exports = Plugin
|
|
@@ -1,111 +1,129 @@
|
|
|
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
|
-
const
|
|
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
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
this._items
|
|
73
|
-
this
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
1
|
+
class Queue {
|
|
2
|
+
constructor() {
|
|
3
|
+
this._items = []
|
|
4
|
+
this._head = 0
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
get size() {
|
|
8
|
+
return this._items.length - this._head
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
get first() {
|
|
12
|
+
return this._items[this._head] || null
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
get last() {
|
|
16
|
+
return this._items[this._items.length - 1] || null
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
add(...tracks) {
|
|
20
|
+
this._items.push(...tracks)
|
|
21
|
+
return this
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
remove(track) {
|
|
25
|
+
const idx = this._items.indexOf(track, this._head)
|
|
26
|
+
if (idx === -1) return false
|
|
27
|
+
const removed = this._items[idx]
|
|
28
|
+
this._items.splice(idx, 1)
|
|
29
|
+
if (removed?.dispose) removed.dispose()
|
|
30
|
+
return true
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
clear() {
|
|
34
|
+
for (let i = this._head; i < this._items.length; i++) {
|
|
35
|
+
if (this._items[i]?.dispose) this._items[i].dispose()
|
|
36
|
+
}
|
|
37
|
+
this._items.length = 0
|
|
38
|
+
this._head = 0
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
shuffle() {
|
|
42
|
+
if (this._head > 0) {
|
|
43
|
+
if (this._head > 0) {
|
|
44
|
+
const len = this._items.length - this._head
|
|
45
|
+
for (let i = 0; i < len; i++) {
|
|
46
|
+
this._items[i] = this._items[this._head + i]
|
|
47
|
+
}
|
|
48
|
+
this._items.length = len
|
|
49
|
+
this._head = 0
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
for (let i = this._items.length - 1; i > 0; i--) {
|
|
53
|
+
const j = Math.floor(Math.random() * (i + 1))
|
|
54
|
+
const temp = this._items[i]
|
|
55
|
+
this._items[i] = this._items[j]
|
|
56
|
+
this._items[j] = temp
|
|
57
|
+
}
|
|
58
|
+
return this
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
move(from, to) {
|
|
62
|
+
const actualFrom = from + this._head
|
|
63
|
+
const actualTo = to + this._head
|
|
64
|
+
if (
|
|
65
|
+
from < 0 ||
|
|
66
|
+
actualFrom >= this._items.length ||
|
|
67
|
+
to < 0 ||
|
|
68
|
+
actualTo >= this._items.length
|
|
69
|
+
)
|
|
70
|
+
return this
|
|
71
|
+
const [item] = this._items.splice(actualFrom, 1)
|
|
72
|
+
this._items.splice(actualTo, 0, item)
|
|
73
|
+
return this
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
swap(index1, index2) {
|
|
77
|
+
const actual1 = index1 + this._head
|
|
78
|
+
const actual2 = index2 + this._head
|
|
79
|
+
if (
|
|
80
|
+
index1 < 0 ||
|
|
81
|
+
actual1 >= this._items.length ||
|
|
82
|
+
index2 < 0 ||
|
|
83
|
+
actual2 >= this._items.length
|
|
84
|
+
)
|
|
85
|
+
return this
|
|
86
|
+
const temp = this._items[actual1]
|
|
87
|
+
this._items[actual1] = this._items[actual2]
|
|
88
|
+
this._items[actual2] = temp
|
|
89
|
+
return this
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
peek() {
|
|
93
|
+
return this.first
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
toArray() {
|
|
97
|
+
return this._items.slice(this._head)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
at(index) {
|
|
101
|
+
return this._items[this._head + index] || null
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
dequeue() {
|
|
105
|
+
if (this._head >= this._items.length) return undefined
|
|
106
|
+
const item = this._items[this._head]
|
|
107
|
+
this._items[this._head] = undefined // Allow GC
|
|
108
|
+
this._head++
|
|
109
|
+
if (this._head > 0 && this._head > this._items.length / 2) {
|
|
110
|
+
const len = this._items.length - this._head
|
|
111
|
+
for (let i = 0; i < len; i++) {
|
|
112
|
+
this._items[i] = this._items[this._head + i]
|
|
113
|
+
}
|
|
114
|
+
this._items.length = len
|
|
115
|
+
this._head = 0
|
|
116
|
+
}
|
|
117
|
+
return item
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
isEmpty() {
|
|
121
|
+
return this.size === 0
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
enqueue(track) {
|
|
125
|
+
return this.add(track)
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
module.exports = Queue
|