Skip to content

Commit

Permalink
⚑ feat (release πŸ€–): Stelle v3.0 πŸŽ‰(#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilG-MC authored Dec 2, 2024
2 parents 4be45be + add1da2 commit 09d5997
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stelle-music",
"version": "0.3.0-BLAZER",
"version": "0.3.0.1-BLAZER",
"description": "A music bot.",
"main": "./dist/index.js",
"type": "module",
Expand Down
1 change: 1 addition & 0 deletions src/lavalink/player/resumed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default new Lavalink({
await player.connect();

player.filterManager.data = data.filters;
player.repeatMode = session.repeatMode;

if (data.track) player.queue.current = client.manager.utils.buildTrack(data.track, session.me);

Expand Down
13 changes: 12 additions & 1 deletion src/lavalink/player/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,19 @@ export default new Lavalink({
) {
if (newPlayerJson.queue?.current) newPlayerJson.queue.current.userData = {};

const {
ping: _p,
createdTimeStamp: _cts,
lavalinkVolume: _lv,
equalizer: _eq,
lastPositionChange: _lpc,
paused: _pd,
playing: _pg,
...newJson
} = newPlayerJson;

sessions.set<StellePlayerJson>(newPlayer.guildId, {
...newPlayerJson,
...newJson,
messageId: newPlayer.get("messageId"),
enabledAutoplay: newPlayer.get("enabledAutoplay"),
localeString: newPlayer.get<string | undefined>("localeString"),
Expand Down
5 changes: 3 additions & 2 deletions src/structures/utils/classes/client/Sessions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { LavalinkNodeOptions, PlayerJson } from "lavalink-client";
import type { LavalinkNodeOptions } from "lavalink-client";
import { InvalidSessionId } from "#stelle/errors";
import type { StellePlayerJson } from "#stelle/types";

import MeowDB from "meowdb";

Expand All @@ -24,7 +25,7 @@ export class StelleSessions {
* The nodes map.
*/
readonly nodes: Map<string, string> = new Map(
Object.entries<PlayerJson>(this.storage.all()).map(([_, session]) => [session.nodeId!, session.nodeSessionId!]),
Object.entries<StellePlayerJson>(this.storage.all()).map(([_, session]) => [session.nodeId!, session.nodeSessionId!]),
);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/structures/utils/data/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const DEBUG_MODE: boolean = getFlag("--debug");
/**
* Stelle eval secrets regex.
*/
export const SECRETS_REGEX: RegExp = /\b(?:client\.(?:config)|config|env|process\.env|eval|atob|btoa)\b/;
export const SECRETS_REGEX: RegExp = /\b(?:client\.(?:config)|config|env|process\.(?:env|exit)|eval|atob|btoa)\b/;

/**
*
Expand Down
2 changes: 1 addition & 1 deletion src/structures/utils/functions/overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function onBotPermissionsFail(ctx: AnyContext, permissions: Permiss
fields: [
{
name: messages.events.permissions.bot.field,
value: permissions.map((p) => `- ${messages.events.permissions.list[p]}`).join("\n- "),
value: permissions.map((p) => `${messages.events.permissions.list[p]}`).join("\n- "),
},
],
},
Expand Down
5 changes: 4 additions & 1 deletion src/structures/utils/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ export type AutoplayMode = "enabled" | "disabled";
export type PausedMode = "pause" | "resume";
export type NonCommandOptions = Omit<Options, "category">;

export type StellePlayerJson = PlayerJson & {
export type StellePlayerJson = Omit<
PlayerJson,
"ping" | "createdTimeStamp" | "lavalinkVolume" | "equalizer" | "lastPositionChange" | "paused" | "playing"
> & {
messageId?: string;
enabledAutoplay?: boolean;
me?: ClientUser;
Expand Down

0 comments on commit 09d5997

Please sign in to comment.