hoshimi 0.3.5 β 0.3.7-dev-22018371309.0
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 +22 -0
- package/README.md +141 -141
- package/dist/index.d.mts +2164 -1591
- package/dist/index.d.ts +2164 -1591
- package/dist/index.js +634 -204
- package/dist/index.mjs +620 -201
- package/package.json +33 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
The MIT License (MIT)
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2024 Ganyu Studios
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<h1>Hoshimi (BETA)</h1>
|
|
3
|
-
<p>A lavalink@v4 client easy to use, up-to-date, and of course</p>
|
|
4
|
-
<div align="center">
|
|
5
|
-
<img src="https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white" />
|
|
6
|
-
<img src="https://img.shields.io/badge/MIT-green?style=for-the-badge" />
|
|
7
|
-
</div>
|
|
8
|
-
<br/>
|
|
9
|
-
<img alt="hoshimi" src="./assets/logo.png" />
|
|
10
|
-
|
|
11
|
-

|
|
12
|
-

|
|
13
|
-
|
|
14
|
-
<p>
|
|
15
|
-
<a href="https://www.npmjs.com/package/hoshimi">
|
|
16
|
-
<img src="https://nodei.co/npm/hoshimi.png?downloads=true&stars=true" alt="NPM Install: hoshimi" />
|
|
17
|
-
</a>
|
|
18
|
-
</p>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
## π¦ Features
|
|
22
|
-
- π **V4**: Works with lavalink v4 and their features (wip).
|
|
23
|
-
- π **Node Manager**: Manage nodes, auto leastβused selection, session resume and more.
|
|
24
|
-
- βΆοΈ **Autoplay**: YouTube and Spotify recommendations out of the box; easily extend with your own function.
|
|
25
|
-
- π **Lyrics**: Control your lyrics with live-lyrics updates; validates required plugins.
|
|
26
|
-
- π **REST + WebSocket**: Typed REST helpers, player/session control, decode single/multiple tracks.
|
|
27
|
-
- π£ **Events**: Granular events with debug levels.
|
|
28
|
-
- π§© **Extensible**: Override structures with your own ones.
|
|
29
|
-
- π§ͺ **Safety & DX**: Strict validation, descriptive errors, TypeScript-first API build, and formatting/linting.
|
|
30
|
-
- π **Filters**: Built-in filters, easy management and easy to use!
|
|
31
|
-
|
|
32
|
-
## βοΈ Requirements
|
|
33
|
-
- **Runtime** - atleast one of:
|
|
34
|
-
- [Node.js](https://nodejs.org) v22+
|
|
35
|
-
- [Bun](https://bun.com) v1.3+
|
|
36
|
-
- [Deno](https://deno.com) v2.5+ (unstable)
|
|
37
|
-
|
|
38
|
-
## π¦ Installation
|
|
39
|
-
|
|
40
|
-
```sh
|
|
41
|
-
# Stable... and the development one (unstable)...
|
|
42
|
-
|
|
43
|
-
# Using NPM
|
|
44
|
-
npm install hoshimi # Stable
|
|
45
|
-
npm install https://github.com/Ganyu-Studios/Hoshimi.git # Development
|
|
46
|
-
|
|
47
|
-
# Using PNPM
|
|
48
|
-
pnpm install hoshimi
|
|
49
|
-
pnpm install https://github.com/Ganyu-Studios/Hoshimi.git
|
|
50
|
-
|
|
51
|
-
# Using YARN
|
|
52
|
-
yarn add hoshimi
|
|
53
|
-
yarn add https://github.com/Ganyu-Studios/Hoshimi.git
|
|
54
|
-
|
|
55
|
-
# Using BUN
|
|
56
|
-
bun add hoshimi
|
|
57
|
-
bun add https://github.com/Ganyu-Studios/Hoshimi.git
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## π Basic Setup
|
|
62
|
-
|
|
63
|
-
You can read [this](/bot/src/index.ts) or you can follow this one:
|
|
64
|
-
|
|
65
|
-
```typescript
|
|
66
|
-
import { Hoshimi } from "hoshimi"; // She is all ears!
|
|
67
|
-
import { Client } from "seyfert"; // Only example client, you can use whatever you want...
|
|
68
|
-
|
|
69
|
-
const client = new Client(); // https://www.seyfert.dev/guide
|
|
70
|
-
|
|
71
|
-
const hoshimi = new Hoshimi({
|
|
72
|
-
nodes: [
|
|
73
|
-
{
|
|
74
|
-
host: "localhost",
|
|
75
|
-
port: 2333,
|
|
76
|
-
password: "youshallnotpass",
|
|
77
|
-
},
|
|
78
|
-
], // Add more nodes if you want!
|
|
79
|
-
sendPayload(guildId, payload) {
|
|
80
|
-
// Your client send to shard payload function
|
|
81
|
-
client.gateway.send(client.gateway.calculateShardId(guildId), payload);
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
// Bind the manager into your client!
|
|
86
|
-
client.hoshimi = hoshimi;
|
|
87
|
-
|
|
88
|
-
// FOLLOW YOUR CLIENT EVENT IMPLEMENTATION
|
|
89
|
-
// THIS IS ONLY A EXAMPLE, NOT A REAL USAGE
|
|
90
|
-
client.events.values.READY = {
|
|
91
|
-
__filePath: null,
|
|
92
|
-
data: { name: "ready", once: true },
|
|
93
|
-
run(user, client) {
|
|
94
|
-
client.logger.info(`Logged in as ${user.username}`);
|
|
95
|
-
|
|
96
|
-
// Call the manager to initialize hoshimi
|
|
97
|
-
hoshimi.init({ ...user, username: user.username });
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
client.events.values.RAW = {
|
|
102
|
-
__filePath: null,
|
|
103
|
-
data: { name: "raw" },
|
|
104
|
-
async run(data, client) {
|
|
105
|
-
// Call the handler on the gateway dispatch events
|
|
106
|
-
await hoshimi.updateVoiceState(data);
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
(async () => {
|
|
111
|
-
await client.start();
|
|
112
|
-
})();
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## π Used By
|
|
116
|
-
|
|
117
|
-
- For now, no one is using it :(
|
|
118
|
-
|
|
119
|
-
## π Additional Notes
|
|
120
|
-
I am currently working on this package.</br> This package takes some ideas provided from libraries like:
|
|
121
|
-
|
|
122
|
-
- π¦ [`lavalink-client`](https://github.com/Tomato6966/lavalink-client/)
|
|
123
|
-
- π¦ [`kazagumo`](https://github.com/Takiyo0/Kazagumo)
|
|
124
|
-
- π¦ [`distube`](https://github.com/skick1234/DisTube)
|
|
125
|
-
- π¦ [`discord-player`](https://github.com/Androz2091/discord-player)
|
|
126
|
-
- π¦ [`shoukaku`](https://github.com/shipgirlproject/Shoukaku)
|
|
127
|
-
|
|
128
|
-
**I'm taking their job as a base for this project, I love their job, all of them, I just took some
|
|
129
|
-
stuff because i'm too lazy to make my own.**</br> If anyone of them wants to
|
|
130
|
-
talk to me to remove their stuff, they can.</br>
|
|
131
|
-
|
|
132
|
-
But made with my code style and my knowledge and of course up-to-date.
|
|
133
|
-
|
|
134
|
-
## π License
|
|
135
|
-
|
|
136
|
-
Copyright Β© 2025 [Ganyu Studios](https://github.com/Ganyu-Studios).
|
|
137
|
-
|
|
138
|
-
This project is [MIT](LICENSE) licensed.
|
|
139
|
-
|
|
140
|
-
- *The character and assets are not my property, property of miHoYo Co. Ltd. (HoYoverse)*
|
|
141
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>Hoshimi (BETA)</h1>
|
|
3
|
+
<p>A lavalink@v4 client easy to use, up-to-date, and of course</p>
|
|
4
|
+
<div align="center">
|
|
5
|
+
<img src="https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white" />
|
|
6
|
+
<img src="https://img.shields.io/badge/MIT-green?style=for-the-badge" />
|
|
7
|
+
</div>
|
|
8
|
+
<br/>
|
|
9
|
+
<img alt="hoshimi" src="./assets/logo.png" />
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
<p>
|
|
15
|
+
<a href="https://www.npmjs.com/package/hoshimi">
|
|
16
|
+
<img src="https://nodei.co/npm/hoshimi.png?downloads=true&stars=true" alt="NPM Install: hoshimi" />
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
## π¦ Features
|
|
22
|
+
- π **V4**: Works with lavalink v4 and their features (wip).
|
|
23
|
+
- π **Node Manager**: Manage nodes, auto leastβused selection, session resume and more.
|
|
24
|
+
- βΆοΈ **Autoplay**: YouTube and Spotify recommendations out of the box; easily extend with your own function.
|
|
25
|
+
- π **Lyrics**: Control your lyrics with live-lyrics updates; validates required plugins.
|
|
26
|
+
- π **REST + WebSocket**: Typed REST helpers, player/session control, decode single/multiple tracks.
|
|
27
|
+
- π£ **Events**: Granular events with debug levels.
|
|
28
|
+
- π§© **Extensible**: Override structures with your own ones.
|
|
29
|
+
- π§ͺ **Safety & DX**: Strict validation, descriptive errors, TypeScript-first API build, and formatting/linting.
|
|
30
|
+
- π **Filters**: Built-in filters, easy management and easy to use!
|
|
31
|
+
|
|
32
|
+
## βοΈ Requirements
|
|
33
|
+
- **Runtime** - atleast one of:
|
|
34
|
+
- [Node.js](https://nodejs.org) v22+
|
|
35
|
+
- [Bun](https://bun.com) v1.3+
|
|
36
|
+
- [Deno](https://deno.com) v2.5+ (unstable)
|
|
37
|
+
|
|
38
|
+
## π¦ Installation
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
# Stable... and the development one (unstable)...
|
|
42
|
+
|
|
43
|
+
# Using NPM
|
|
44
|
+
npm install hoshimi # Stable
|
|
45
|
+
npm install https://github.com/Ganyu-Studios/Hoshimi.git # Development
|
|
46
|
+
|
|
47
|
+
# Using PNPM
|
|
48
|
+
pnpm install hoshimi
|
|
49
|
+
pnpm install https://github.com/Ganyu-Studios/Hoshimi.git
|
|
50
|
+
|
|
51
|
+
# Using YARN
|
|
52
|
+
yarn add hoshimi
|
|
53
|
+
yarn add https://github.com/Ganyu-Studios/Hoshimi.git
|
|
54
|
+
|
|
55
|
+
# Using BUN
|
|
56
|
+
bun add hoshimi
|
|
57
|
+
bun add https://github.com/Ganyu-Studios/Hoshimi.git
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## π Basic Setup
|
|
62
|
+
|
|
63
|
+
You can read [this](/bot/src/index.ts) or you can follow this one:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
import { Hoshimi } from "hoshimi"; // She is all ears!
|
|
67
|
+
import { Client } from "seyfert"; // Only example client, you can use whatever you want...
|
|
68
|
+
|
|
69
|
+
const client = new Client(); // https://www.seyfert.dev/guide
|
|
70
|
+
|
|
71
|
+
const hoshimi = new Hoshimi({
|
|
72
|
+
nodes: [
|
|
73
|
+
{
|
|
74
|
+
host: "localhost",
|
|
75
|
+
port: 2333,
|
|
76
|
+
password: "youshallnotpass",
|
|
77
|
+
},
|
|
78
|
+
], // Add more nodes if you want!
|
|
79
|
+
sendPayload(guildId, payload) {
|
|
80
|
+
// Your client send to shard payload function
|
|
81
|
+
client.gateway.send(client.gateway.calculateShardId(guildId), payload);
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Bind the manager into your client!
|
|
86
|
+
client.hoshimi = hoshimi;
|
|
87
|
+
|
|
88
|
+
// FOLLOW YOUR CLIENT EVENT IMPLEMENTATION
|
|
89
|
+
// THIS IS ONLY A EXAMPLE, NOT A REAL USAGE
|
|
90
|
+
client.events.values.READY = {
|
|
91
|
+
__filePath: null,
|
|
92
|
+
data: { name: "ready", once: true },
|
|
93
|
+
run(user, client) {
|
|
94
|
+
client.logger.info(`Logged in as ${user.username}`);
|
|
95
|
+
|
|
96
|
+
// Call the manager to initialize hoshimi
|
|
97
|
+
hoshimi.init({ ...user, username: user.username });
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
client.events.values.RAW = {
|
|
102
|
+
__filePath: null,
|
|
103
|
+
data: { name: "raw" },
|
|
104
|
+
async run(data, client) {
|
|
105
|
+
// Call the handler on the gateway dispatch events
|
|
106
|
+
await hoshimi.updateVoiceState(data);
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
(async () => {
|
|
111
|
+
await client.start();
|
|
112
|
+
})();
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## π Used By
|
|
116
|
+
|
|
117
|
+
- For now, no one is using it :(
|
|
118
|
+
|
|
119
|
+
## π Additional Notes
|
|
120
|
+
I am currently working on this package.</br> This package takes some ideas provided from libraries like:
|
|
121
|
+
|
|
122
|
+
- π¦ [`lavalink-client`](https://github.com/Tomato6966/lavalink-client/)
|
|
123
|
+
- π¦ [`kazagumo`](https://github.com/Takiyo0/Kazagumo)
|
|
124
|
+
- π¦ [`distube`](https://github.com/skick1234/DisTube)
|
|
125
|
+
- π¦ [`discord-player`](https://github.com/Androz2091/discord-player)
|
|
126
|
+
- π¦ [`shoukaku`](https://github.com/shipgirlproject/Shoukaku)
|
|
127
|
+
|
|
128
|
+
**I'm taking their job as a base for this project, I love their job, all of them, I just took some
|
|
129
|
+
stuff because i'm too lazy to make my own.**</br> If anyone of them wants to
|
|
130
|
+
talk to me to remove their stuff, they can.</br>
|
|
131
|
+
|
|
132
|
+
But made with my code style and my knowledge and of course up-to-date.
|
|
133
|
+
|
|
134
|
+
## π License
|
|
135
|
+
|
|
136
|
+
Copyright Β© 2025 [Ganyu Studios](https://github.com/Ganyu-Studios).
|
|
137
|
+
|
|
138
|
+
This project is [MIT](LICENSE) licensed.
|
|
139
|
+
|
|
140
|
+
- *The character and assets are not my property, property of miHoYo Co. Ltd. (HoYoverse)*
|
|
141
|
+
|
|
142
142
|
> *Made with πβ€οΈπͺ... A project made by the community, for the community.*
|