magmastream 2.8.5 → 2.8.6-dev.2
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/LICENSE +176 -176
- package/README.md +76 -76
- package/dist/index.d.ts +3 -3
- package/dist/structures/Manager.js +10 -2
- package/dist/structures/Node.js +11 -14
- package/dist/structures/Player.js +11 -29
- package/package.json +90 -90
package/LICENSE
CHANGED
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&height=200§ion=header&text=Magmastream&fontSize=80&fontAlignY=35&animation=twinkling&fontColor=gradient" />
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
**Magmastream** is a powerful and feature-rich Lavalink wrapper for Node.js, designed to supercharge your audio applications. Currently optimized exclusively for Lavalink version 4, Magmastream delivers seamless audio streaming capabilities with elegant simplicity.
|
|
6
|
-
|
|
7
|
-
## Useful Links
|
|
8
|
-
|
|
9
|
-
- [Documentation](https://docs.magmastream.com)
|
|
10
|
-
- [Example Bot](https://github.com/Magmastream-NPM/magmastream_basics_bot)
|
|
11
|
-
|
|
12
|
-
## Contributing
|
|
13
|
-
|
|
14
|
-
We warmly welcome contributions that help elevate Magmastream to new heights! Whether you've discovered bugs that need squashing or have brilliant ideas for improvements, we'd love to see your contributions. Here's how you can join our community of developers:
|
|
15
|
-
|
|
16
|
-
1. Fork the repository to your own GitHub account.
|
|
17
|
-
2. Create a fresh branch that reflects your intended changes.
|
|
18
|
-
3. Implement your awesome modifications and fixes.
|
|
19
|
-
4. Rigorously test your changes to ensure everything works flawlessly.
|
|
20
|
-
5. Submit a detailed pull request, clearly describing the enhancements you've made.
|
|
21
|
-
|
|
22
|
-
Together, we can make Magmastream an even more powerful and robust tool for everyone! Your expertise and creativity are invaluable to our project's growth. 🚀✨
|
|
23
|
-
|
|
24
|
-
## Bug Fixes
|
|
25
|
-
|
|
26
|
-
Have you discovered and squashed some pesky bugs? Fantastic! We'd love for you to [contribute](#contributing) by submitting a pull request. Your dedication to enhancing Magmastream's stability and reliability is invaluable to our community. Together, we can make this project even more robust! 🐛✨
|
|
27
|
-
|
|
28
|
-
## Support
|
|
29
|
-
Need help or have questions? Feel free to create an issue, and our community will be happy to assist you!
|
|
30
|
-
For real-time support and engaging discussions, join our vibrant [Discord Support Server](https://discord.com/invite/HV59Z3zEjt).
|
|
31
|
-
|
|
32
|
-
## Used By
|
|
33
|
-
|
|
34
|
-
| Name | Creator |
|
|
35
|
-
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
|
|
36
|
-
| [Lava Jukebox](https://discord.com/api/oauth2/authorize?client_id=887651843742793779&permissions=-1&redirect_uri=https%3A%2F%2Fdiscord.gg%2F4ZaXbbYSTZ&response_type=code&scope=guilds.join%20bot%20applications.commands) | Abel Purnwasy |
|
|
37
|
-
| [Stal](https://discord.com/oauth2/authorize?client_id=923938180263182356&scope=bot%20applications.commands&permissions=27648861246) | memte |
|
|
38
|
-
| [Lunio](https://discord.com/api/oauth2/authorize?client_id=945030475779551415&permissions=61991952&scope=bot+applications.commands) | vexi |
|
|
39
|
-
| [JukeDisc](https://discord.com/oauth2/authorize?client_id=1109751797549105176&permissions=968552214080&scope=bot+applications.commands) | Theo |
|
|
40
|
-
| [Cool Music](https://discord.com/oauth2/authorize?client_id=923529398425096193&permissions=12888394808&redirect_uri=https%3A%2F%2Fdiscord.gg%2Fcool-music-support-925619107460698202&response_type=code&scope=bot%20identify%20applications.commands) | Itz Random |
|
|
41
|
-
| [Soundy](https://dsc.gg/sndy) | iaMJ |
|
|
42
|
-
| [HamBot](https://discord.com/oauth2/authorize?client_id=1049314312776335390) | yanishamburger|
|
|
43
|
-
| [Miyu](https://discord.com/oauth2/authorize?client_id=1277180179273482280&permissions=572851999731703&response_type=code&redirect_uri=https%3A%2F%2Fdiscord.gg%2Ftn3nbFB8nX&integration_type=0&scope=identify+applications.commands+bot) | Kenver |
|
|
44
|
-
| [Savage Bot](https://discord.com/oauth2/authorize?client_id=823703707522433054&permissions=8&scope=bot%20applications.commands) | Savage |
|
|
45
|
-
|
|
46
|
-
Want to showcase your bot? Feel free to create a pull request and add it to our growing list of amazing bots powered by Magmastream!
|
|
47
|
-
|
|
48
|
-
## Contributors
|
|
49
|
-
|
|
50
|
-
A heartfelt thank you to all our amazing contributors who have poured their time and expertise into making Magmastream truly exceptional! Your dedication and passion continue to drive this project forward. 🚀✨
|
|
51
|
-
|
|
52
|
-
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
53
|
-
<!-- prettier-ignore-start -->
|
|
54
|
-
<!-- markdownlint-disable -->
|
|
55
|
-
<table>
|
|
56
|
-
<tbody>
|
|
57
|
-
<tr>
|
|
58
|
-
<td align="center" valign="top" width="14.28%"><a href="https://discord.gg/JCaTDJRz7P"><img src="https://avatars.githubusercontent.com/u/58607083?v=4?s=100" width="100px;" alt="Darek"/><br /><sub><b>Darek</b></sub></a><br /><a href="#doc-realdarek" title="Documentation">📖</a></td>
|
|
59
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Vexify4103"><img src="https://avatars.githubusercontent.com/u/47192617?v=4?s=100" width="100px;" alt="Vexify4103"/><br /><sub><b>Vexify4103</b></sub></a><br /><a href="#code-Vexify4103" title="Code">💻</a> <a href="#doc-Vexify4103" title="Documentation">📖</a></td>
|
|
60
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ItzRandom23"><img src="https://avatars.githubusercontent.com/u/100831398?v=4?s=100" width="100px;" alt="Itz Random"/><br /><sub><b>Itz Random</b></sub></a><br /><a href="#code-ItzRandom23" title="Code">💻</a></td>
|
|
61
|
-
</tr>
|
|
62
|
-
</tbody>
|
|
63
|
-
</table>
|
|
64
|
-
|
|
65
|
-
<!-- markdownlint-restore -->
|
|
66
|
-
<!-- prettier-ignore-end -->
|
|
67
|
-
|
|
68
|
-
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<img src="https://contributers.code-fy.tech/Magmastream-NPM?yousuck">
|
|
72
|
-
|
|
73
|
-
## Stats
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-

|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&height=200§ion=header&text=Magmastream&fontSize=80&fontAlignY=35&animation=twinkling&fontColor=gradient" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
**Magmastream** is a powerful and feature-rich Lavalink wrapper for Node.js, designed to supercharge your audio applications. Currently optimized exclusively for Lavalink version 4, Magmastream delivers seamless audio streaming capabilities with elegant simplicity.
|
|
6
|
+
|
|
7
|
+
## Useful Links
|
|
8
|
+
|
|
9
|
+
- [Documentation](https://docs.magmastream.com)
|
|
10
|
+
- [Example Bot](https://github.com/Magmastream-NPM/magmastream_basics_bot)
|
|
11
|
+
|
|
12
|
+
## Contributing
|
|
13
|
+
|
|
14
|
+
We warmly welcome contributions that help elevate Magmastream to new heights! Whether you've discovered bugs that need squashing or have brilliant ideas for improvements, we'd love to see your contributions. Here's how you can join our community of developers:
|
|
15
|
+
|
|
16
|
+
1. Fork the repository to your own GitHub account.
|
|
17
|
+
2. Create a fresh branch that reflects your intended changes.
|
|
18
|
+
3. Implement your awesome modifications and fixes.
|
|
19
|
+
4. Rigorously test your changes to ensure everything works flawlessly.
|
|
20
|
+
5. Submit a detailed pull request, clearly describing the enhancements you've made.
|
|
21
|
+
|
|
22
|
+
Together, we can make Magmastream an even more powerful and robust tool for everyone! Your expertise and creativity are invaluable to our project's growth. 🚀✨
|
|
23
|
+
|
|
24
|
+
## Bug Fixes
|
|
25
|
+
|
|
26
|
+
Have you discovered and squashed some pesky bugs? Fantastic! We'd love for you to [contribute](#contributing) by submitting a pull request. Your dedication to enhancing Magmastream's stability and reliability is invaluable to our community. Together, we can make this project even more robust! 🐛✨
|
|
27
|
+
|
|
28
|
+
## Support
|
|
29
|
+
Need help or have questions? Feel free to create an issue, and our community will be happy to assist you!
|
|
30
|
+
For real-time support and engaging discussions, join our vibrant [Discord Support Server](https://discord.com/invite/HV59Z3zEjt).
|
|
31
|
+
|
|
32
|
+
## Used By
|
|
33
|
+
|
|
34
|
+
| Name | Creator |
|
|
35
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
|
|
36
|
+
| [Lava Jukebox](https://discord.com/api/oauth2/authorize?client_id=887651843742793779&permissions=-1&redirect_uri=https%3A%2F%2Fdiscord.gg%2F4ZaXbbYSTZ&response_type=code&scope=guilds.join%20bot%20applications.commands) | Abel Purnwasy |
|
|
37
|
+
| [Stal](https://discord.com/oauth2/authorize?client_id=923938180263182356&scope=bot%20applications.commands&permissions=27648861246) | memte |
|
|
38
|
+
| [Lunio](https://discord.com/api/oauth2/authorize?client_id=945030475779551415&permissions=61991952&scope=bot+applications.commands) | vexi |
|
|
39
|
+
| [JukeDisc](https://discord.com/oauth2/authorize?client_id=1109751797549105176&permissions=968552214080&scope=bot+applications.commands) | Theo |
|
|
40
|
+
| [Cool Music](https://discord.com/oauth2/authorize?client_id=923529398425096193&permissions=12888394808&redirect_uri=https%3A%2F%2Fdiscord.gg%2Fcool-music-support-925619107460698202&response_type=code&scope=bot%20identify%20applications.commands) | Itz Random |
|
|
41
|
+
| [Soundy](https://dsc.gg/sndy) | iaMJ |
|
|
42
|
+
| [HamBot](https://discord.com/oauth2/authorize?client_id=1049314312776335390) | yanishamburger|
|
|
43
|
+
| [Miyu](https://discord.com/oauth2/authorize?client_id=1277180179273482280&permissions=572851999731703&response_type=code&redirect_uri=https%3A%2F%2Fdiscord.gg%2Ftn3nbFB8nX&integration_type=0&scope=identify+applications.commands+bot) | Kenver |
|
|
44
|
+
| [Savage Bot](https://discord.com/oauth2/authorize?client_id=823703707522433054&permissions=8&scope=bot%20applications.commands) | Savage |
|
|
45
|
+
|
|
46
|
+
Want to showcase your bot? Feel free to create a pull request and add it to our growing list of amazing bots powered by Magmastream!
|
|
47
|
+
|
|
48
|
+
## Contributors
|
|
49
|
+
|
|
50
|
+
A heartfelt thank you to all our amazing contributors who have poured their time and expertise into making Magmastream truly exceptional! Your dedication and passion continue to drive this project forward. 🚀✨
|
|
51
|
+
|
|
52
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
53
|
+
<!-- prettier-ignore-start -->
|
|
54
|
+
<!-- markdownlint-disable -->
|
|
55
|
+
<table>
|
|
56
|
+
<tbody>
|
|
57
|
+
<tr>
|
|
58
|
+
<td align="center" valign="top" width="14.28%"><a href="https://discord.gg/JCaTDJRz7P"><img src="https://avatars.githubusercontent.com/u/58607083?v=4?s=100" width="100px;" alt="Darek"/><br /><sub><b>Darek</b></sub></a><br /><a href="#doc-realdarek" title="Documentation">📖</a></td>
|
|
59
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Vexify4103"><img src="https://avatars.githubusercontent.com/u/47192617?v=4?s=100" width="100px;" alt="Vexify4103"/><br /><sub><b>Vexify4103</b></sub></a><br /><a href="#code-Vexify4103" title="Code">💻</a> <a href="#doc-Vexify4103" title="Documentation">📖</a></td>
|
|
60
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ItzRandom23"><img src="https://avatars.githubusercontent.com/u/100831398?v=4?s=100" width="100px;" alt="Itz Random"/><br /><sub><b>Itz Random</b></sub></a><br /><a href="#code-ItzRandom23" title="Code">💻</a></td>
|
|
61
|
+
</tr>
|
|
62
|
+
</tbody>
|
|
63
|
+
</table>
|
|
64
|
+
|
|
65
|
+
<!-- markdownlint-restore -->
|
|
66
|
+
<!-- prettier-ignore-end -->
|
|
67
|
+
|
|
68
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
<img src="https://contributers.code-fy.tech/Magmastream-NPM?yousuck">
|
|
72
|
+
|
|
73
|
+
## Stats
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+

|
package/dist/index.d.ts
CHANGED
|
@@ -932,7 +932,7 @@ declare class Manager extends EventEmitter {
|
|
|
932
932
|
* @param requester
|
|
933
933
|
* @returns The search result.
|
|
934
934
|
*/
|
|
935
|
-
search<T
|
|
935
|
+
search<T = unknown>(query: string | SearchQuery, requester?: T): Promise<SearchResult>;
|
|
936
936
|
/**
|
|
937
937
|
* Creates a player or returns one if it already exists.
|
|
938
938
|
* @param options The options to create the player with.
|
|
@@ -1445,7 +1445,7 @@ declare class Player {
|
|
|
1445
1445
|
* @param query
|
|
1446
1446
|
* @param requester
|
|
1447
1447
|
*/
|
|
1448
|
-
search<T
|
|
1448
|
+
search<T = unknown>(query: string | SearchQuery, requester?: T): Promise<SearchResult>;
|
|
1449
1449
|
/**
|
|
1450
1450
|
* Connects the player to the voice channel.
|
|
1451
1451
|
* @throws {RangeError} If no voice channel has been set.
|
|
@@ -1518,7 +1518,7 @@ declare class Player {
|
|
|
1518
1518
|
* recommended track if the first one doesn't work.
|
|
1519
1519
|
* @returns {this} - The player instance.
|
|
1520
1520
|
*/
|
|
1521
|
-
setAutoplay(autoplayState: boolean, botUser?:
|
|
1521
|
+
setAutoplay<T = unknown>(autoplayState: boolean, botUser?: T, tries?: number): this;
|
|
1522
1522
|
/**
|
|
1523
1523
|
* Gets recommended tracks and returns an array of tracks.
|
|
1524
1524
|
* @param {Track} track - The track to find recommendations for.
|
|
@@ -167,7 +167,7 @@ class Manager extends events_1.EventEmitter {
|
|
|
167
167
|
playlist = {
|
|
168
168
|
name: playlistData.info.name,
|
|
169
169
|
playlistInfo: playlistData.pluginInfo,
|
|
170
|
-
requester,
|
|
170
|
+
requester: requester,
|
|
171
171
|
tracks,
|
|
172
172
|
duration: tracks.reduce((acc, cur) => acc + (cur.duration || 0), 0),
|
|
173
173
|
};
|
|
@@ -179,7 +179,9 @@ class Manager extends events_1.EventEmitter {
|
|
|
179
179
|
if (!/(youtube\.com|youtu\.be)/.test(track.uri))
|
|
180
180
|
return track;
|
|
181
181
|
const { cleanTitle, cleanAuthor } = this.parseYouTubeTitle(track.title, track.author);
|
|
182
|
-
|
|
182
|
+
track.title = cleanTitle;
|
|
183
|
+
track.author = cleanAuthor;
|
|
184
|
+
return track;
|
|
183
185
|
};
|
|
184
186
|
if (playlist) {
|
|
185
187
|
playlist.tracks = playlist.tracks.map(processTrack);
|
|
@@ -290,6 +292,12 @@ class Manager extends events_1.EventEmitter {
|
|
|
290
292
|
}
|
|
291
293
|
if (update.user_id !== this.options.clientId)
|
|
292
294
|
return;
|
|
295
|
+
if (!player.voiceState.sessionId && player.voiceState.event) {
|
|
296
|
+
if (player.state !== Utils_1.StateTypes.Disconnected) {
|
|
297
|
+
await player.destroy();
|
|
298
|
+
}
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
293
301
|
return await this.handleVoiceStateUpdate(player, update);
|
|
294
302
|
}
|
|
295
303
|
/**
|
package/dist/structures/Node.js
CHANGED
|
@@ -536,17 +536,16 @@ class Node {
|
|
|
536
536
|
*/
|
|
537
537
|
async trackEnd(player, track, payload) {
|
|
538
538
|
const { reason } = payload;
|
|
539
|
-
const oldPlayer = player;
|
|
540
|
-
// If the track failed to load or was cleaned up
|
|
541
539
|
const skipFlag = player.get("skipFlag");
|
|
542
|
-
if (!skipFlag && (!player.queue.previous.length || player.queue.previous.
|
|
540
|
+
if (!skipFlag && (!player.queue.previous.length || player.queue.previous[0].track !== player.queue.current.track)) {
|
|
543
541
|
// Store the current track in the previous tracks queue
|
|
544
|
-
player.queue.previous.
|
|
542
|
+
player.queue.previous.push(player.queue.current);
|
|
545
543
|
// Limit the previous tracks queue to maxPreviousTracks
|
|
546
544
|
if (player.queue.previous.length > this.manager.options.maxPreviousTracks) {
|
|
547
|
-
player.queue.previous.
|
|
545
|
+
player.queue.previous.shift();
|
|
548
546
|
}
|
|
549
547
|
}
|
|
548
|
+
const oldPlayer = player;
|
|
550
549
|
// Handle track end events
|
|
551
550
|
switch (reason) {
|
|
552
551
|
case Utils_1.TrackEndReasonTypes.LoadFailed:
|
|
@@ -555,10 +554,12 @@ class Node {
|
|
|
555
554
|
await this.handleFailedTrack(player, track, payload);
|
|
556
555
|
break;
|
|
557
556
|
case Utils_1.TrackEndReasonTypes.Replaced:
|
|
557
|
+
// Handle the case when a track was replaced
|
|
558
|
+
break;
|
|
558
559
|
case Utils_1.TrackEndReasonTypes.Stopped:
|
|
559
560
|
// If the track was forcibly replaced
|
|
560
561
|
if (player.queue.length) {
|
|
561
|
-
this.
|
|
562
|
+
await this.playNextTrack(player, track, payload);
|
|
562
563
|
}
|
|
563
564
|
else {
|
|
564
565
|
await this.queueEnd(player, track, payload);
|
|
@@ -573,7 +574,6 @@ class Node {
|
|
|
573
574
|
// If there's another track in the queue
|
|
574
575
|
if (player.queue.length) {
|
|
575
576
|
await this.playNextTrack(player, track, payload);
|
|
576
|
-
break;
|
|
577
577
|
}
|
|
578
578
|
else {
|
|
579
579
|
await this.queueEnd(player, track, payload);
|
|
@@ -603,7 +603,7 @@ class Node {
|
|
|
603
603
|
*/
|
|
604
604
|
async handleAutoplay(player, attempt = 0) {
|
|
605
605
|
// If autoplay is not enabled or all attempts have failed, early exit
|
|
606
|
-
if (!player.isAutoplay || attempt === player.autoplayTries || !player.queue.previous
|
|
606
|
+
if (!player.isAutoplay || attempt === player.autoplayTries || !player.queue.previous.length)
|
|
607
607
|
return false;
|
|
608
608
|
// Get the Last.fm API key and the available source managers
|
|
609
609
|
const apiKey = this.manager.options.lastFmApiKey;
|
|
@@ -613,17 +613,16 @@ class Node {
|
|
|
613
613
|
// If YouTube is available and this is the last attempt, use YouTube
|
|
614
614
|
const shouldUseYouTube = (!apiKey && enabledSources.includes("youtube")) || // Fallback to YouTube if Last.fm is not available
|
|
615
615
|
(attempt === player.autoplayTries - 1 && player.autoplayTries > 1 && enabledSources.includes("youtube")); // Use YouTube on the last attempt
|
|
616
|
+
const lastTrack = player.queue.previous[player.queue.previous.length - 1];
|
|
616
617
|
if (shouldUseYouTube) {
|
|
617
618
|
// Use YouTube-based autoplay
|
|
618
|
-
|
|
619
|
-
return await this.handleYouTubeAutoplay(player, player.queue.previous?.at(-1) ?? null);
|
|
619
|
+
return await this.handleYouTubeAutoplay(player, lastTrack);
|
|
620
620
|
}
|
|
621
621
|
// Handle Last.fm-based autoplay (or other platforms)
|
|
622
622
|
const selectedSource = this.selectPlatform(enabledSources);
|
|
623
623
|
if (selectedSource) {
|
|
624
624
|
// Use the selected source to handle autoplay
|
|
625
|
-
|
|
626
|
-
return await this.handlePlatformAutoplay(player, player.queue.previous?.at(-1) ?? null, selectedSource, apiKey);
|
|
625
|
+
return await this.handlePlatformAutoplay(player, lastTrack, selectedSource, apiKey);
|
|
627
626
|
}
|
|
628
627
|
// If no source is available, return false
|
|
629
628
|
return false;
|
|
@@ -801,7 +800,6 @@ class Node {
|
|
|
801
800
|
* @private
|
|
802
801
|
*/
|
|
803
802
|
async handleFailedTrack(player, track, payload) {
|
|
804
|
-
// player.queue.previous = player.queue.current;
|
|
805
803
|
player.queue.current = player.queue.shift();
|
|
806
804
|
if (!player.queue.current) {
|
|
807
805
|
await this.queueEnd(player, track, payload);
|
|
@@ -896,7 +894,6 @@ class Node {
|
|
|
896
894
|
attempts++;
|
|
897
895
|
}
|
|
898
896
|
// If all attempts fail, reset the player state and emit queueEnd
|
|
899
|
-
player.queue.previous = [];
|
|
900
897
|
player.playing = false;
|
|
901
898
|
this.manager.emit(Manager_1.ManagerEventTypes.QueueEnd, player, track, payload);
|
|
902
899
|
}
|
|
@@ -9,7 +9,6 @@ const Queue_1 = require("./Queue");
|
|
|
9
9
|
const Utils_1 = require("./Utils");
|
|
10
10
|
const _ = tslib_1.__importStar(require("lodash"));
|
|
11
11
|
const playerCheck_1 = tslib_1.__importDefault(require("../utils/playerCheck"));
|
|
12
|
-
const discord_js_1 = require("discord.js");
|
|
13
12
|
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
14
13
|
class Player {
|
|
15
14
|
options;
|
|
@@ -221,17 +220,19 @@ class Player {
|
|
|
221
220
|
* @emits {PlayerStateUpdate} - Emitted when the player state is updated.
|
|
222
221
|
*/
|
|
223
222
|
async destroy(disconnect = true) {
|
|
223
|
+
if (this.state === Utils_1.StateTypes.Disconnected)
|
|
224
|
+
return true;
|
|
224
225
|
const oldPlayer = this ? { ...this } : null;
|
|
225
226
|
this.state = Utils_1.StateTypes.Destroying;
|
|
226
227
|
if (disconnect) {
|
|
227
228
|
await this.disconnect();
|
|
228
229
|
}
|
|
229
230
|
await this.node.rest.destroyPlayer(this.guildId);
|
|
230
|
-
this.manager.emit(Manager_1.ManagerEventTypes.PlayerDestroy, this);
|
|
231
231
|
this.queue.clear();
|
|
232
232
|
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer, null, {
|
|
233
233
|
changeType: Manager_1.PlayerStateEventTypes.PlayerDestroy,
|
|
234
234
|
});
|
|
235
|
+
this.manager.emit(Manager_1.ManagerEventTypes.PlayerDestroy, this);
|
|
235
236
|
return this.manager.players.delete(this.guildId);
|
|
236
237
|
}
|
|
237
238
|
/**
|
|
@@ -345,7 +346,7 @@ class Player {
|
|
|
345
346
|
if (!botUser) {
|
|
346
347
|
throw new TypeError("botUser must be provided when enabling autoplay.");
|
|
347
348
|
}
|
|
348
|
-
if (!
|
|
349
|
+
if (!["ClientUser", "User"].includes(botUser.constructor.name)) {
|
|
349
350
|
throw new TypeError("botUser must be a user-object.");
|
|
350
351
|
}
|
|
351
352
|
this.autoplayTries = tries && typeof tries === "number" && tries > 0 ? tries : 3; // Default to 3 if invalid
|
|
@@ -707,35 +708,20 @@ class Player {
|
|
|
707
708
|
* @throws {RangeError} If the amount is greater than the queue length.
|
|
708
709
|
*/
|
|
709
710
|
async stop(amount) {
|
|
710
|
-
const oldPlayer =
|
|
711
|
+
const oldPlayer = { ...this };
|
|
711
712
|
let removedTracks = [];
|
|
712
|
-
// If an amount is provided, remove that many tracks from the queue.
|
|
713
713
|
if (typeof amount === "number" && amount > 1) {
|
|
714
|
-
if (amount > this.queue.length)
|
|
714
|
+
if (amount > this.queue.length)
|
|
715
715
|
throw new RangeError("Cannot skip more than the queue length.");
|
|
716
|
-
}
|
|
717
716
|
removedTracks = this.queue.slice(0, amount - 1);
|
|
718
717
|
this.queue.splice(0, amount - 1);
|
|
719
718
|
}
|
|
720
|
-
|
|
721
|
-
// If no amount is provided, remove the current track if it exists.
|
|
722
|
-
if (this.queue.current) {
|
|
723
|
-
removedTracks.push(this.queue.current);
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
// Stop the player and send an event to the manager.
|
|
727
|
-
await this.node.rest.updatePlayer({
|
|
719
|
+
this.node.rest.updatePlayer({
|
|
728
720
|
guildId: this.guildId,
|
|
729
721
|
data: {
|
|
730
722
|
encodedTrack: null,
|
|
731
723
|
},
|
|
732
724
|
});
|
|
733
|
-
if (this.queue.length) {
|
|
734
|
-
this.queue.current = this.queue.shift();
|
|
735
|
-
// If autoplay is enabled, play the next track
|
|
736
|
-
if (this.manager.options.autoPlay)
|
|
737
|
-
await this.play();
|
|
738
|
-
}
|
|
739
725
|
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer, this, {
|
|
740
726
|
changeType: Manager_1.PlayerStateEventTypes.QueueChange,
|
|
741
727
|
details: {
|
|
@@ -794,18 +780,14 @@ class Player {
|
|
|
794
780
|
// Capture the current state of the player before making changes.
|
|
795
781
|
const oldPlayer = { ...this };
|
|
796
782
|
// Store the current track before changing it.
|
|
797
|
-
let currentTrackBeforeChange;
|
|
798
|
-
if (this.queue.current) {
|
|
799
|
-
currentTrackBeforeChange = this.queue.current;
|
|
800
|
-
}
|
|
783
|
+
// let currentTrackBeforeChange: Track | null = this.queue.current ? (this.queue.current as Track) : null;
|
|
801
784
|
// Get the last played track and remove it from the history
|
|
802
|
-
const lastTrack = this.queue.previous.
|
|
785
|
+
const lastTrack = this.queue.previous.pop();
|
|
803
786
|
// Set the skip flag to true to prevent the onTrackEnd event from playing the next track.
|
|
804
787
|
this.set("skipFlag", true);
|
|
805
788
|
await this.play(lastTrack);
|
|
806
|
-
// Add the current track back to the
|
|
807
|
-
if (currentTrackBeforeChange)
|
|
808
|
-
this.queue.unshift(currentTrackBeforeChange);
|
|
789
|
+
// Add the current track back to the end of the previous queue
|
|
790
|
+
// if (currentTrackBeforeChange) this.queue.push(currentTrackBeforeChange);
|
|
809
791
|
// Emit a player state update event indicating the track change to previous.
|
|
810
792
|
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer, this, {
|
|
811
793
|
changeType: Manager_1.PlayerStateEventTypes.TrackChange,
|
package/package.json
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "magmastream",
|
|
3
|
-
"version": "2.8.
|
|
4
|
-
"description": "A user-friendly Lavalink client designed for NodeJS.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "tsc",
|
|
12
|
-
"types": "rtb --dist dist",
|
|
13
|
-
"lint": "eslint src",
|
|
14
|
-
"lint:fix": "eslint --fix src",
|
|
15
|
-
"ci": "run-s lint:fix lint build types"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@favware/rollup-type-bundler": "^4.0.0",
|
|
19
|
-
"@types/lodash": "^4.17.15",
|
|
20
|
-
"@types/node": "^22.13.5",
|
|
21
|
-
"@types/ws": "^8.5.14",
|
|
22
|
-
"@typescript-eslint/eslint-plugin": "^8.24.1",
|
|
23
|
-
"@typescript-eslint/parser": "^8.24.1",
|
|
24
|
-
"eslint": "^9.21.0",
|
|
25
|
-
"npm-run-all": "^4.1.5",
|
|
26
|
-
"typedoc": "^0.27.8",
|
|
27
|
-
"typedoc-plugin-no-inherit": "^1.5.0",
|
|
28
|
-
"typescript": "^5.7.3"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@discordjs/collection": "^2.1.1",
|
|
32
|
-
"axios": "^1.7.9",
|
|
33
|
-
"events": "^3.3.0",
|
|
34
|
-
"lodash": "^4.17.21",
|
|
35
|
-
"tslib": "^2.8.1",
|
|
36
|
-
"ws": "^8.18.1"
|
|
37
|
-
},
|
|
38
|
-
"peerDependencies": {
|
|
39
|
-
"discord.js": ">=13.0.0 <15.0.0"
|
|
40
|
-
},
|
|
41
|
-
"engines": {
|
|
42
|
-
"node": ">=16.0.0"
|
|
43
|
-
},
|
|
44
|
-
"eslintConfig": {
|
|
45
|
-
"root": true,
|
|
46
|
-
"parser": "@typescript-eslint/parser",
|
|
47
|
-
"plugins": [
|
|
48
|
-
"@typescript-eslint"
|
|
49
|
-
],
|
|
50
|
-
"rules": {
|
|
51
|
-
"object-curly-spacing": [
|
|
52
|
-
"error",
|
|
53
|
-
"always"
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
"extends": [
|
|
57
|
-
"eslint:recommended",
|
|
58
|
-
"plugin:@typescript-eslint/recommended"
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
"keywords": [
|
|
62
|
-
"lavalink client",
|
|
63
|
-
"wrapper",
|
|
64
|
-
"typescript",
|
|
65
|
-
"discord.js",
|
|
66
|
-
"node.js",
|
|
67
|
-
"java",
|
|
68
|
-
"javascript",
|
|
69
|
-
"audio streaming",
|
|
70
|
-
"music bot",
|
|
71
|
-
"voice chat",
|
|
72
|
-
"discord integration",
|
|
73
|
-
"high performance",
|
|
74
|
-
"scalable",
|
|
75
|
-
"easy-to-use",
|
|
76
|
-
"feature-rich",
|
|
77
|
-
"cross-platform",
|
|
78
|
-
"seamless integration",
|
|
79
|
-
"community support",
|
|
80
|
-
"documentation",
|
|
81
|
-
"open-source",
|
|
82
|
-
"lavalink",
|
|
83
|
-
"magmastream"
|
|
84
|
-
],
|
|
85
|
-
"repository": {
|
|
86
|
-
"url": "git+https://github.com/Blackfort-Hosting/magmastream.git#main"
|
|
87
|
-
},
|
|
88
|
-
"homepage": "https://docs.magmastream.com",
|
|
89
|
-
"author": "Abel Purnwasy",
|
|
90
|
-
"license": "Apache-2.0"
|
|
1
|
+
{
|
|
2
|
+
"name": "magmastream",
|
|
3
|
+
"version": "2.8.6-dev.2",
|
|
4
|
+
"description": "A user-friendly Lavalink client designed for NodeJS.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"types": "rtb --dist dist",
|
|
13
|
+
"lint": "eslint src",
|
|
14
|
+
"lint:fix": "eslint --fix src",
|
|
15
|
+
"ci": "run-s lint:fix lint build types"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@favware/rollup-type-bundler": "^4.0.0",
|
|
19
|
+
"@types/lodash": "^4.17.15",
|
|
20
|
+
"@types/node": "^22.13.5",
|
|
21
|
+
"@types/ws": "^8.5.14",
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "^8.24.1",
|
|
23
|
+
"@typescript-eslint/parser": "^8.24.1",
|
|
24
|
+
"eslint": "^9.21.0",
|
|
25
|
+
"npm-run-all": "^4.1.5",
|
|
26
|
+
"typedoc": "^0.27.8",
|
|
27
|
+
"typedoc-plugin-no-inherit": "^1.5.0",
|
|
28
|
+
"typescript": "^5.7.3"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@discordjs/collection": "^2.1.1",
|
|
32
|
+
"axios": "^1.7.9",
|
|
33
|
+
"events": "^3.3.0",
|
|
34
|
+
"lodash": "^4.17.21",
|
|
35
|
+
"tslib": "^2.8.1",
|
|
36
|
+
"ws": "^8.18.1"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"discord.js": ">=13.0.0 <15.0.0"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=16.0.0"
|
|
43
|
+
},
|
|
44
|
+
"eslintConfig": {
|
|
45
|
+
"root": true,
|
|
46
|
+
"parser": "@typescript-eslint/parser",
|
|
47
|
+
"plugins": [
|
|
48
|
+
"@typescript-eslint"
|
|
49
|
+
],
|
|
50
|
+
"rules": {
|
|
51
|
+
"object-curly-spacing": [
|
|
52
|
+
"error",
|
|
53
|
+
"always"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"extends": [
|
|
57
|
+
"eslint:recommended",
|
|
58
|
+
"plugin:@typescript-eslint/recommended"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"keywords": [
|
|
62
|
+
"lavalink client",
|
|
63
|
+
"wrapper",
|
|
64
|
+
"typescript",
|
|
65
|
+
"discord.js",
|
|
66
|
+
"node.js",
|
|
67
|
+
"java",
|
|
68
|
+
"javascript",
|
|
69
|
+
"audio streaming",
|
|
70
|
+
"music bot",
|
|
71
|
+
"voice chat",
|
|
72
|
+
"discord integration",
|
|
73
|
+
"high performance",
|
|
74
|
+
"scalable",
|
|
75
|
+
"easy-to-use",
|
|
76
|
+
"feature-rich",
|
|
77
|
+
"cross-platform",
|
|
78
|
+
"seamless integration",
|
|
79
|
+
"community support",
|
|
80
|
+
"documentation",
|
|
81
|
+
"open-source",
|
|
82
|
+
"lavalink",
|
|
83
|
+
"magmastream"
|
|
84
|
+
],
|
|
85
|
+
"repository": {
|
|
86
|
+
"url": "git+https://github.com/Blackfort-Hosting/magmastream.git#main"
|
|
87
|
+
},
|
|
88
|
+
"homepage": "https://docs.magmastream.com",
|
|
89
|
+
"author": "Abel Purnwasy",
|
|
90
|
+
"license": "Apache-2.0"
|
|
91
91
|
}
|