Skip to content

Commit

Permalink
⚑ feat (release πŸ€–): Stelle v3.4.1 πŸŽ‰(#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilG-MC authored Jan 6, 2025
2 parents 078fa8b + 45dfdab commit d82b2a5
Show file tree
Hide file tree
Showing 18 changed files with 188 additions and 68 deletions.
80 changes: 80 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
## πŸ“¦ Changelogs

## [v3.3.0](https://github.com/Ganyu-Studios/stelle-music/releases/tag/v3.3.0) - 2024-12-26
### What's changed
* ⚑ Feat (release πŸ€–): Stelle v3.3.0 πŸŽ‰ by [@EvilG-MC](https://github.com/EvilG-MC) in [#34](https://github.com/Ganyu-Studios/stelle-music/pull/34)

**Full Changelog**: https://github.com/Ganyu-Studios/stelle-music/compare/v3.2.5...v3.3.0

## [v3.2.5](https://github.com/Ganyu-Studios/stelle-music/releases/tag/v3.2.5) - 2024-12-24
### What's changed
* Fix: Filter developer commands and voice status method by [@pryzmian](https://github.com/pryzmian) in [#32](https://github.com/Ganyu-Studios/stelle-music/pull/32)

**Full Changelog**: https://github.com/Ganyu-Studios/stelle-music/compare/v3.2.1...v3.2.5

## [v3.2.1](https://github.com/Ganyu-Studios/stelle-music/releases/tag/v3.2.1) - 2024-12-12
### What's changed
* Added voice status function.
* Changes in markdown files.
* Small changes.

**Full Changelog**: https://github.com/Ganyu-Studios/stelle-music/compare/v3.1.1...v3.2.1

## [v3.1.1](https://github.com/Ganyu-Studios/stelle-music/releases/tag/v3.1.1) - 2024-12-10
### What's changed
* Updated dependencies.
* Added the function to resume players when a node is down.
* Updated markdown files.
* Also updated the application.yml example.
* Also added the `FAQ` section.
* Some code changes.

**Full Changelog**: https://github.com/Ganyu-Studios/stelle-music/compare/v3.0.1...v3.1.1

## [v3.0.1](https://github.com/Ganyu-Studios/stelle-music/releases/tag/v3.0.1) - 2024-12-02
### What's changed
* ⚑ Feat (release πŸ€–): Stelle v3.0.1 πŸŽ‰ by [@EvilG-MC](https://github.com/EvilG-MC) in [#25](https://github.com/Ganyu-Studios/stelle-music/pull/25)

**Full Changelog**: https://github.com/Ganyu-Studios/stelle-music/compare/v3.0...v3.0.1

## [v3.0](https://github.com/Ganyu-Studios/stelle-music/releases/tag/v3.0) - 2024-12-02
### What's changed
* Updated markdown files by [@EvilG-MC](https://github.com/EvilG-MC) in [#22](https://github.com/Ganyu-Studios/stelle-music/pull/22)
* Feat: Node sessions by [@EvilG-MC](https://github.com/EvilG-MC) in [#23](https://github.com/Ganyu-Studios/stelle-music/pull/23)
* ⚑ Feat (release πŸ€–): Stelle v3.0 πŸŽ‰ by [@EvilG-MC](https://github.com/EvilG-MC) in [#24](https://github.com/Ganyu-Studios/stelle-music/pull/24)

**Full Changelog**: https://github.com/Ganyu-Studios/stelle-music/compare/v2.9.5...v3.0

## [v2.9.5](https://github.com/Ganyu-Studios/stelle-music/releases/tag/v2.9.5) - 2024-11-11
### What's changed
* ⚑ Feat (release πŸ€–): Stelle v2.9.5 πŸŽ‰ by [@EvilG-MC](https://github.com/EvilG-MC) in [#19](https://github.com/Ganyu-Studios/stelle-music/pull/19)
* I forgot to change the version :skull: by [@EvilG-MC](https://github.com/EvilG-MC) in [#21](https://github.com/Ganyu-Studios/stelle-music/pull/21)

**Full Changelog**: https://github.com/Ganyu-Studios/stelle-music/compare/v2.9...v2.9.5

## [v2.9](https://github.com/Ganyu-Studios/stelle-music/releases/tag/v2.9) - 2024-08-29
### What's changed
* Test by [@EvilG-MC](https://github.com/EvilG-MC) in [#12](https://github.com/Ganyu-Studios/stelle-music/pull/12)
* TimeFormat by [@SagiriIkeda](https://github.com/SagiriIkeda) in [#13](https://github.com/Ganyu-Studios/stelle-music/pull/13)

### New contributors
* [@SagiriIkeda](https://github.com/SagiriIkeda) made their first contribution in [#13](https://github.com/Ganyu-Studios/stelle-music/pull/13)

**Full Changelog**: https://github.com/Ganyu-Studios/stelle-music/compare/v2.8...v2.9

## [v2.8](https://github.com/Ganyu-Studios/stelle-music/releases/tag/v2.8) - 2024-08-14
### What's changed
* Update: Updated dependencies
* Fix: Attempting to address more issues.

_"Fixed"_ [#10](https://github.com/Ganyu-Studios/stelle-music/issues/10)

**Full Changelog**: https://github.com/Ganyu-Studios/stelle-music/compare/v2.7...v2.8

## [v2.7](https://github.com/Ganyu-Studios/stelle-music/releases/tag/v2.7) - 2024-07-28
### What's changed
* Fix: Some internal issues.
* Feat: Now autoplay works with one track.
* Updates: General updates

**Full Changelog**: https://github.com/Ganyu-Studios/stelle-music/compare/v2.6...v2.7
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "stelle-music",
"version": "0.3.3.0-BLAZER",
"version": "0.3.4.1-BLAZER",
"description": "A music bot.",
"main": "./dist/index.js",
"type": "module",
"packageManager": "[email protected].1+sha512.1acb565e6193efbebda772702950469150cf12bcc764262e7587e71d19dc98a423dff9536e57ea44c49bdf790ff694e83c27be5faa23d67e0c033b583be4bfcf",
"packageManager": "[email protected].3+sha512.1f79bc245a66eb0b07c5d4d83131240774642caaa86ef7d0434ab47c0d16f66b04e21e0c086eb61e62c77efc4d7f7ec071afad3796af64892fae66509173893a",
"homepage": "https://github.com/Ganyu-Studios/stelle-music#readme",
"engines": {
"node": ">= 22.11.0"
Expand Down Expand Up @@ -36,16 +36,16 @@
},
"dependencies": {
"@prisma/client": "^6.1.0",
"lavalink-client": "^2.4.3",
"lavalink-client": "^2.4.4",
"meowdb": "^2.2.3",
"seyfert": "github:tiramisulabs/seyfert",
"yunaforseyfert": "^1.1.0"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@types/node": "^22.10.2",
"@types/node": "^22.10.5",
"husky": "^9.1.7",
"lint-staged": "^15.2.11",
"lint-staged": "^15.3.0",
"prisma": "^6.1.0",
"tsx": "^4.19.2",
"typescript": "^5.7.2"
Expand Down
48 changes: 24 additions & 24 deletions pnpm-lock.yaml

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

74 changes: 52 additions & 22 deletions src/commands/user/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ import {
ActionRow,
Command,
type CommandContext,
ContextMenuCommand,
Declare,
Embed,
LocalesT,
Options,
StringSelectOption,
SubCommand,
createStringOption,
} from "seyfert";
import { StelleOptions } from "#stelle/decorators";

import { EmbedColors } from "seyfert/lib/common/index.js";
import { type APIApplicationCommandOption, MessageFlags } from "seyfert/lib/types/index.js";
import type { APIApplicationCommandOption, ApplicationCommandOptionType, LocaleString } from "seyfert/lib/types/index.js";
import { MessageFlags } from "seyfert/lib/types/index.js";
import { StelleCategory } from "#stelle/types";
import { EmbedPaginator, StelleStringMenu } from "#stelle/utils/Paginator.js";
import { formatOptions } from "#stelle/utils/functions/formatter.js";
Expand Down Expand Up @@ -47,7 +50,6 @@ export default class HelpCommand extends Command {
.filter((item, index, commands) => commands.indexOf(item) === index);

const getAlias = (category: StelleCategory) => messages.commands.help.aliases[category];
const getFormat = (options: APIApplicationCommandOption[]) => formatOptions(options, messages.events.optionTypes);

if (!options.command) {
const paginator = new EmbedPaginator(ctx).setDisabled(true);
Expand All @@ -71,16 +73,7 @@ export default class HelpCommand extends Command {
paginator.setEmbeds([]).setDisabled(false);

for (let i = 0; i < commands.length; i += 5) {
const commandList = commands.slice(i, i + 5).map((x) => {
// cuz this types are weird
const command = x.toJSON() as ReturnType<Command["toJSON"]>;
return {
name: command.name,
description: command.description,
description_localizations: command.description_localizations,
options: getFormat(command.options).map((option) => option.option),
};
});
const commandList = commands.slice(i, i + 5);

paginator.addEmbed(
new Embed()
Expand All @@ -95,9 +88,8 @@ export default class HelpCommand extends Command {
.setDescription(
messages.commands.help.selectMenu.options.description({
options: commandList
.map(
(command) =>
`\`${command.name} ${command.options.length ? `${command.options.join(" ")}` : ""}\`\n* ${command.description_localizations?.[ctx.interaction?.locale!] ?? command.description}`,
.map((command) =>
parseCommand(command, messages.events.optionTypes, ctx.interaction?.locale),
)
.join("\n\n"),
}),
Expand Down Expand Up @@ -126,9 +118,7 @@ export default class HelpCommand extends Command {
return;
}

const command = client.commands!.values.filter((command) => !command.guildId).find((command) => command.name === options.command) as
| Command
| undefined;
const command = client.commands!.values.filter((command) => !command.guildId).find((command) => command.name === options.command);
if (!command)
return ctx.editOrReply({
flags: MessageFlags.Ephemeral,
Expand All @@ -140,9 +130,6 @@ export default class HelpCommand extends Command {
],
});

const commandJson = command.toJSON();
const commandOptions = getFormat(commandJson.options).map((option) => option.option);

const embed = new Embed()
.setColor(client.config.color.success)
.setThumbnail(ctx.author.avatarURL())
Expand All @@ -154,10 +141,53 @@ export default class HelpCommand extends Command {
)
.setDescription(
messages.commands.help.selectMenu.options.description({
options: `\`${command.name} ${commandOptions.length ? commandOptions.join(" ") : ""}\`\n* ${command.description_localizations?.[ctx.interaction?.locale!] ?? command.description}`,
options: parseCommand(command, messages.events.optionTypes, ctx.interaction?.locale),
}),
);

await ctx.editOrReply({ embeds: [embed] });
}
}

/**
*
* Parses a command to a string.
* @param command The command to parse.
* @param optionsType The options type.
* @param locale The locale to use.
* @returns
*/
function parseCommand(
command: Command | ContextMenuCommand,
optionsType: Record<ApplicationCommandOptionType, string>,
locale?: LocaleString,
): string {
if (command instanceof ContextMenuCommand) return command.name;
let content = command.name;
for (const option of command.options ?? []) {
if (option instanceof SubCommand) {
content += `\n ${parseSubCommand(option, optionsType)}`;
} else {
content += ` ${formatOptions([option as APIApplicationCommandOption], optionsType).at(0)?.option}`;
}
}

return `\`${content}\`\n* ${command.description_localizations?.[locale!] ?? command.description}`;
}

/**
*
* Parses a subcommand to a string.
* @param subCommand The subcommand to parse.
* @param optionsType The options type.
* @returns
*/
function parseSubCommand(subCommand: SubCommand, optionsType: Record<ApplicationCommandOptionType, string>): string {
if (!subCommand.options?.length) return subCommand.name;
return `β†ͺ ${subCommand.group ? subCommand.group : ""} ${subCommand.name} ${formatOptions(
subCommand.options as APIApplicationCommandOption[],
optionsType,
)
.map((x) => x.option)
.join(" ")}`.trim();
}
Loading

0 comments on commit d82b2a5

Please sign in to comment.