Skip to content

Commit

Permalink
⚑ feat (release πŸ€–): Stelle v3.2.5 πŸŽ‰(#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilG-MC authored Dec 24, 2024
2 parents b35fe9c + d2fda24 commit e4c4a05
Show file tree
Hide file tree
Showing 18 changed files with 170 additions and 119 deletions.
3 changes: 0 additions & 3 deletions .vscode/snippets.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@
"import { Declare, Command } from \"seyfert\";",
"import { StelleOptions } from \"#stelle/decorators\";",
"",
"import { Configuration } from \"#stelle/data/Configuration.js\";",
"",
"@Declare({",
" name: \"${1:example}\",",
" description: \"${2:example}\",",
" guildId: Configuration.guildIds,",
" integrationTypes: [\"GuildInstall\"],",
" contexts: [\"Guild\"],",
"})",
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "stelle-music",
"version": "0.3.2.1-BLAZER",
"version": "0.3.2.5-BLAZER",
"description": "A music bot.",
"main": "./dist/index.js",
"type": "module",
"packageManager": "[email protected].0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c",
"packageManager": "[email protected].1+sha512.1acb565e6193efbebda772702950469150cf12bcc764262e7587e71d19dc98a423dff9536e57ea44c49bdf790ff694e83c27be5faa23d67e0c033b583be4bfcf",
"homepage": "https://github.com/Ganyu-Studios/stelle-music#readme",
"engines": {
"node": ">= 22.11.0"
Expand All @@ -14,7 +14,7 @@
"typecheck": "tsc --noEmit",
"clean": "node ./scripts/clean.js && pnpm build",
"start": "node ./dist/index.js",
"dev": "tsx ./src/index.ts --debug",
"dev": "tsx ./src/index.ts --debug --dev",
"lint": "biome lint --write ./src",
"format": "biome check --write ./src",
"prepare": "husky"
Expand All @@ -35,18 +35,18 @@
"url": "https://github.com/Ganyu-Studios/stelle-music/issues"
},
"dependencies": {
"@prisma/client": "^6.0.1",
"lavalink-client": "^2.4.2",
"@prisma/client": "^6.1.0",
"lavalink-client": "^2.4.3",
"meowdb": "^2.2.3",
"seyfert": "github:tiramisulabs/seyfert",
"yunaforseyfert": "^1.0.4"
"yunaforseyfert": "^1.1.0"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@types/node": "^22.10.2",
"husky": "^9.1.7",
"lint-staged": "^15.2.11",
"prisma": "^6.0.1",
"prisma": "^6.1.0",
"tsx": "^4.19.2",
"typescript": "^5.7.2"
},
Expand Down
98 changes: 49 additions & 49 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions seyfert.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import { GatewayIntentBits } from "seyfert/lib/types/index.js";
import { config } from "seyfert";

import { DEBUG_MODE } from "#stelle/data/Constants.js";
import { DEV_MODE, DEBUG_MODE } from "#stelle/data/Constants.js";

const output = DEBUG_MODE ? "src" : "dist";
const output = DEV_MODE ? "src" : "dist";

export default config.bot({
token: process.env.TOKEN ?? "Trailblazer",
Expand Down
2 changes: 0 additions & 2 deletions src/commands/developer/emit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Command, type CommandContext, Declare, type Guild, Options, createStrin
import { StelleOptions } from "#stelle/decorators";

import { MessageFlags } from "seyfert/lib/types/index.js";
import { Configuration } from "#stelle/data/Configuration.js";

const options = {
event: createStringOption({
Expand All @@ -24,7 +23,6 @@ const options = {
@Declare({
name: "emit",
description: "Emit a event.",
guildId: Configuration.guildIds,
defaultMemberPermissions: ["ManageGuild", "Administrator"],
integrationTypes: ["GuildInstall"],
contexts: ["Guild"],
Expand Down
29 changes: 22 additions & 7 deletions src/commands/developer/eval.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
import { Command, type CommandContext, Declare, Embed, type Message, Options, type WebhookMessage, createStringOption } from "seyfert";
import {
Command,
type CommandContext,
Declare,
Embed,
type Message,
Options,
type WebhookMessage,
createIntegerOption,
createStringOption,
} from "seyfert";
import { EmbedColors, Formatter } from "seyfert/lib/common/index.js";
import { StelleOptions } from "#stelle/decorators";

import { Configuration } from "#stelle/data/Configuration.js";
import { getDepth, sliceText } from "#stelle/utils/functions/utils.js";

import { DeclareParserConfig, ParserRecommendedConfig, Watch, Yuna } from "yunaforseyfert";
import { SECRETS_MESSAGES, SECRETS_REGEX } from "#stelle/data/Constants.js";
import { SECRETS_MESSAGES } from "#stelle/data/Constants.js";
import { ms } from "#stelle/utils/TimeFormat.js";

const secretsRegex = /\b(?:client\.(?:config)|config|env|process\.(?:env|exit)|eval|atob|btoa)\b/;
const concatRegex = /".*?"\s*\+\s*".*?"(?:\s*\+\s*".*?")*/;

const options = {
code: createStringOption({
description: "Enter some code.",
required: true,
}),
depth: createIntegerOption({
description: "Enter the depth of the result.",
min_value: 0,
}),
};

@Declare({
name: "eval",
description: "Eval code with Stelle.",
aliases: ["code"],
guildId: Configuration.guildIds,
defaultMemberPermissions: ["ManageGuild", "Administrator"],
integrationTypes: ["GuildInstall"],
contexts: ["Guild"],
Expand Down Expand Up @@ -53,6 +68,7 @@ export default class EvalCommand extends Command {
const { client, options, author, channelId } = ctx;

const start = Date.now();
const depth = options.depth;

let code: string = options.code;
let output: string | null = null;
Expand All @@ -71,15 +87,14 @@ export default class EvalCommand extends Command {
});

try {
const concatText = /".*?"\s*\+\s*".*?"(?:\s*\+\s*".*?")*/;
if (SECRETS_REGEX.test(code.toLowerCase()) || concatText.test(code.toLowerCase()))
if (secretsRegex.test(code.toLowerCase()) || concatRegex.test(code.toLowerCase()))
output = SECRETS_MESSAGES[Math.floor(Math.random() * SECRETS_MESSAGES.length)];
else if (typeof output !== "string") {
if (/^(?:\(?)\s*await\b/.test(code.toLowerCase())) code = `(async () => ${code})()`;

output = await eval(code);
typecode = typeof output;
output = getDepth(output).replaceAll(process.env.TOKEN!, client.token);
output = getDepth(output, depth).replaceAll(process.env.TOKEN!, "🌟").replace(process.env.DATABASE_URL!, "🌟");
}

await ctx.editOrReply({
Expand Down
2 changes: 0 additions & 2 deletions src/commands/developer/reload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import { Command, type CommandContext, Declare } from "seyfert";
import { StelleOptions } from "#stelle/decorators";

import { EmbedColors } from "seyfert/lib/common/index.js";
import { Configuration } from "#stelle/data/Configuration.js";

@Declare({
name: "reload",
description: "Reload Stelle.",
guildId: Configuration.guildIds,
defaultMemberPermissions: ["ManageGuild", "Administrator"],
integrationTypes: ["GuildInstall"],
contexts: ["Guild"],
Expand Down
4 changes: 3 additions & 1 deletion src/commands/user/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ export default class HelpCommand extends Command {
return;
}

const command = client.commands!.values.find((command) => command.name === options.command) as Command | undefined;
const command = client.commands!.values.filter((command) => !command.guildId).find((command) => command.name === options.command) as
| Command
| undefined;
if (!command)
return ctx.editOrReply({
flags: MessageFlags.Ephemeral,
Expand Down
Loading

0 comments on commit e4c4a05

Please sign in to comment.