hoshimi 0.2.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/README.md +139 -0
- package/dist/index.d.mts +5787 -0
- package/dist/index.d.ts +5787 -0
- package/dist/index.js +4577 -0
- package/dist/index.mjs +4510 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
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**: Fully supports the latest v4 lavalink features.
|
|
23
|
+
- π **Node Manager**: Manage nodes, auto leastβused selection by penalties, 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 (WIP)**: 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
|
+
// You client send to shard payload function
|
|
81
|
+
client.gateway.send(client.gateway.calculateShardId(guildId), payload);
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// FOLLOW YOU CLIENT EVENT IMPLEMENTATION
|
|
86
|
+
// THIS IS ONLY A EXAMPLE, NOT A REAL USAGE
|
|
87
|
+
client.events.values.READY = {
|
|
88
|
+
__filePath: null,
|
|
89
|
+
data: { name: "ready", once: true },
|
|
90
|
+
run(user, client) {
|
|
91
|
+
client.logger.info(`Logged in as ${user.username}`);
|
|
92
|
+
|
|
93
|
+
// Call the manager to initialize hoshimi
|
|
94
|
+
hoshimi.init({ ...user, username: user.username });
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
client.events.values.RAW = {
|
|
99
|
+
__filePath: null,
|
|
100
|
+
data: { name: "raw" },
|
|
101
|
+
async run(data, client) {
|
|
102
|
+
// Call the handler on the gateway dispatch events
|
|
103
|
+
await hoshimi.updateVoiceState(data);
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
(async () => {
|
|
108
|
+
await client.start()
|
|
109
|
+
})();
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## π Used By
|
|
113
|
+
|
|
114
|
+
- For now, no one is using it :(
|
|
115
|
+
|
|
116
|
+
## π Additional Notes
|
|
117
|
+
I am currently working on this package.</br> This package takes some ideas provided from libraries like:
|
|
118
|
+
|
|
119
|
+
- π¦ [`lavalink-client`](https://github.com/Tomato6966/lavalink-client/)
|
|
120
|
+
- π¦ [`kazagumo`](https://github.com/Takiyo0/Kazagumo)
|
|
121
|
+
- π¦ [`distube`](https://github.com/skick1234/DisTube)
|
|
122
|
+
- π¦ [`discord-player`](https://github.com/Androz2091/discord-player)
|
|
123
|
+
- π¦ [`shoukaku`](https://github.com/shipgirlproject/Shoukaku)
|
|
124
|
+
|
|
125
|
+
**I'm taking their job as a base for this project, I love their job, all of them, I just took some
|
|
126
|
+
stuff because i'm too lazy to make my own.**</br> If anyone of them wants to
|
|
127
|
+
talk to me to remove their stuff, they can.</br>
|
|
128
|
+
|
|
129
|
+
But made with my code style and my knowledge and of course up-to-date.
|
|
130
|
+
|
|
131
|
+
## π License
|
|
132
|
+
|
|
133
|
+
Copyright Β© 2025 [Ganyu Studios](https://github.com/Ganyu-Studios).
|
|
134
|
+
|
|
135
|
+
This project is [MIT](LICENSE) licensed.
|
|
136
|
+
|
|
137
|
+
- *The character and assets are not my property, property of miHoYo Co. Ltd. (HoYoverse)*
|
|
138
|
+
|
|
139
|
+
> *Made with πβ€οΈπͺ... A project made by the community, for the community.*
|