Skip to content

Commit

Permalink
fix: naming convesional & send options now is flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
KagChi committed Mar 14, 2022
1 parent facea59 commit 7df7a20
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "dist/index.js",
"module": "dist/index.mjs",
"description": "Kirishima is extendable, fast, flexible, asynchronous lavalink client",
"version": "0.2.3",
"version": "0.3.0",
"license": "GPL-3.0",
"repository": {
"url": "https://github.com/kirishima-ship/core"
Expand Down
8 changes: 4 additions & 4 deletions src/Structures/BasePlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ export class BasePlayer {

public constructor(public options: KirishimaPlayerOptions, public kirishima: Kirishima, public node: KirishimaNode) {}

public async connect(): Promise<BasePlayer> {
await this.kirishima.options.send(this.options.guildId, createVoiceChannelJoinPayload(this.options));
public async connect() {
await this.kirishima.options.send(this.options, createVoiceChannelJoinPayload(this.options));
return this;
}

public async disconnect(): Promise<BasePlayer> {
await this.kirishima.options.send(this.options.guildId, createVoiceChannelJoinPayload(this.options, true));
public async disconnect() {
await this.kirishima.options.send(this.options, createVoiceChannelJoinPayload(this.options, true));
return this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function createVoiceChannelJoinPayload(options: KirishimaPlayerOptions, l
op: GatewayOpcodes.VoiceStateUpdate,
d: {
guild_id: options.guildId,
channel_id: leave ? null : options.voiceId,
channel_id: leave ? null : options.channelId,
self_deaf: (options.selfDeaf ??= false),
self_mute: (options.selfMute ??= false)
}
Expand Down
6 changes: 3 additions & 3 deletions src/typings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface KirishimaOptions {
reconnectInterval?: number;
reconnectAttempts?: number;
};
send(guildId: string, payload: payload): Awaitable<unknown>;
send(options: KirishimaPlayerOptions, payload: payload): Awaitable<unknown>;
/** @description customize-able spawn-player handler, allow you to set it to collection or even redis. */
spawnPlayer?: SpawnPlayerOptionHook;
/** @description Used for getting global player, most likely used when `VOICE_SERVER_UPDATE` and `VOICE_SERVER_UPDATE` emits. note: you must provide same major method when customizing player handler. */
Expand Down Expand Up @@ -47,8 +47,8 @@ export interface payload {
export interface KirishimaPlayerOptions {
guildId: string;
shardId?: string;
channelId?: string;
voiceId: string;
channelId: string;
textChannelId?: string;
selfDeaf?: boolean;
selfMute?: boolean;
}
Expand Down

0 comments on commit 7df7a20

Please sign in to comment.