Skip to content

Commit

Permalink
⚑ feat (release πŸ€–): Stelle v3.3.0 πŸŽ‰(#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilG-MC authored Dec 26, 2024
2 parents e4c4a05 + 03b925a commit 078fa8b
Show file tree
Hide file tree
Showing 33 changed files with 374 additions and 236 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.2.5-BLAZER",
"version": "0.3.3.0-BLAZER",
"description": "A music bot.",
"main": "./dist/index.js",
"type": "module",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

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

5 changes: 2 additions & 3 deletions seyfert.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { config } from "seyfert";

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

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

export default config.bot({
token: process.env.TOKEN ?? "Trailblazer",
Expand All @@ -22,8 +22,7 @@ export default config.bot({
* @type {import("seyfert").RuntimeConfig["locations"] & { lavalink: string }}
*/
locations: {
output,
base: "src",
base,
lavalink: "lavalink",
commands: "commands",
components: "components",
Expand Down
8 changes: 2 additions & 6 deletions src/commands/music/autoplay.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandContext, Declare, LocalesT } from "seyfert";
import { Command, type CommandContext, Declare, LocalesT, Middlewares } from "seyfert";
import { StelleOptions } from "#stelle/decorators";

import { StelleCategory } from "#stelle/types";
Expand All @@ -14,13 +14,9 @@ import { getAutoplayState } from "#stelle/utils/functions/utils.js";
@StelleOptions({
cooldown: 5,
category: StelleCategory.Music,
checkPlayer: true,
inVoice: true,
sameVoice: true,
moreTracks: true,
checkNodes: true,
})
@LocalesT("locales.autoplay.name", "locales.autoplay.description")
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer", "checkTracks"])
export default class AutoplayCommand extends Command {
public override async run(ctx: CommandContext) {
const { client, guildId } = ctx;
Expand Down
5 changes: 3 additions & 2 deletions src/commands/music/loop.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandContext, Declare, LocalesT, Options, createStringOption } from "seyfert";
import { Command, type CommandContext, Declare, LocalesT, Middlewares, Options, createStringOption } from "seyfert";
import { StelleOptions } from "#stelle/decorators";

import type { RepeatMode } from "lavalink-client";
Expand Down Expand Up @@ -38,9 +38,10 @@ const options = {
contexts: ["Guild"],
aliases: ["l"],
})
@StelleOptions({ cooldown: 5, category: StelleCategory.Music, checkPlayer: true, inVoice: true, sameVoice: true, checkNodes: true })
@StelleOptions({ cooldown: 5, category: StelleCategory.Music })
@Options(options)
@LocalesT("locales.loop.name", "locales.loop.description")
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer"])
export default class LoopCommand extends Command {
public override async run(ctx: CommandContext<typeof options>) {
const { client, options, guildId } = ctx;
Expand Down
9 changes: 6 additions & 3 deletions src/commands/music/move.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandContext, Declare, LocalesT, Options, createChannelOption } from "seyfert";
import { Command, type CommandContext, Declare, LocalesT, Middlewares, Options, createChannelOption } from "seyfert";
import { StelleOptions } from "#stelle/decorators";
import { StelleCategory } from "#stelle/types";

Expand Down Expand Up @@ -31,9 +31,10 @@ const options = {
contexts: ["Guild"],
aliases: ["mov", "m"],
})
@StelleOptions({ cooldown: 5, category: StelleCategory.Music, checkPlayer: true, inVoice: true, checkNodes: true })
@StelleOptions({ cooldown: 5, category: StelleCategory.Music })
@Options(options)
@LocalesT("locales.move.name", "locales.move.description")
@Middlewares(["checkNodes", "checkVoiceChannel", "checkPlayer"])
export default class MoveCommand extends Command {
public override async run(ctx: CommandContext<typeof options>) {
const { client, options, guildId } = ctx;
Expand All @@ -54,14 +55,16 @@ export default class MoveCommand extends Command {
player.options.voiceChannelId = voice.id;
player.voiceChannelId = voice.id;

const channel = await ctx.channel();

await player.connect();
await ctx.editOrReply({
embeds: [
{
color: client.config.color.success,
description: messages.commands.move({
voiceId: voice.id,
textId: text?.id ?? ctx.channel()?.id ?? "1143606303850483280",
textId: text?.id ?? channel?.id ?? "1143606303850483280",
}),
},
],
Expand Down
5 changes: 3 additions & 2 deletions src/commands/music/nowplaying.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandContext, Declare, LocalesT, type User } from "seyfert";
import { Command, type CommandContext, Declare, LocalesT, Middlewares, type User } from "seyfert";
import { StelleOptions } from "#stelle/decorators";
import { StelleCategory } from "#stelle/types";

Expand All @@ -13,8 +13,9 @@ import { createBar } from "#stelle/utils/functions/utils.js";
contexts: ["Guild"],
aliases: ["np"],
})
@StelleOptions({ cooldown: 5, category: StelleCategory.Music, checkNodes: true, checkPlayer: true })
@StelleOptions({ cooldown: 5, category: StelleCategory.Music })
@LocalesT("locales.nowplaying.name", "locales.nowplaying.description")
@Middlewares(["checkNodes", "checkPlayer"])
export default class NowPlayingCommand extends Command {
public override async run(ctx: CommandContext) {
const { client, guildId } = ctx;
Expand Down
4 changes: 3 additions & 1 deletion src/commands/music/play.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Embed,
LocalesT,
type Message,
Middlewares,
Options,
type User,
type WebhookMessage,
Expand Down Expand Up @@ -73,9 +74,10 @@ const options = {
integrationTypes: ["GuildInstall"],
contexts: ["Guild"],
})
@StelleOptions({ cooldown: 5, category: StelleCategory.Music, inVoice: true, sameVoice: true, checkNodes: true })
@StelleOptions({ cooldown: 5, category: StelleCategory.Music })
@Options(options)
@LocalesT("locales.play.name", "locales.play.description")
@Middlewares(["checkNodes", "checkVoiceChannel", "checkVoicePermissions", "checkBotVoiceChannel"])
export default class PlayCommand extends Command {
public override async run(ctx: CommandContext<typeof options>): Promise<Message | WebhookMessage | void> {
const { options, client, guildId, channelId, member } = ctx;
Expand Down
21 changes: 9 additions & 12 deletions src/commands/music/queue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandContext, Declare, Embed, LocalesT, type User } from "seyfert";
import { Command, type CommandContext, Declare, Embed, LocalesT, Middlewares, type User } from "seyfert";
import { StelleOptions } from "#stelle/decorators";

import { StelleCategory } from "#stelle/types";
Expand All @@ -13,22 +13,19 @@ import { EmbedPaginator } from "#stelle/utils/Paginator.js";
@StelleOptions({
cooldown: 5,
category: StelleCategory.Music,
checkPlayer: true,
inVoice: true,
sameVoice: true,
checkNodes: true,
checkQueue: true,
})
@LocalesT("locales.queue.name", "locales.queue.description")
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer", "checkQueue"])
export default class QueueCommand extends Command {
public override async run(ctx: CommandContext) {
const { client, guildId, author } = ctx;

if (!guildId) return;
const { client, author } = ctx;

const { messages } = await ctx.getLocale();

const player = client.manager.getPlayer(guildId);
const guild = await ctx.guild();
if (!guild) return;

const player = client.manager.getPlayer(guild.id);
if (!player) return;

const tracksPerPage = 20;
Expand All @@ -42,7 +39,7 @@ export default class QueueCommand extends Command {
new Embed()
.setDescription(messages.events.playerQueue({ tracks: tracks.slice(0, tracksPerPage).join("\n") }))
.setColor(client.config.color.extra)
.setThumbnail(ctx.guild()!.iconURL())
.setThumbnail(guild.iconURL())
.setTimestamp()
.setAuthor({ name: author.tag, iconUrl: author.avatarURL() }),
],
Expand All @@ -55,7 +52,7 @@ export default class QueueCommand extends Command {
new Embed()
.setDescription(messages.events.playerQueue({ tracks: tracks.slice(i, i + tracksPerPage).join("\n") }))
.setColor(client.config.color.extra)
.setThumbnail(ctx.guild()!.iconURL())
.setThumbnail(guild.iconURL())
.setTimestamp()
.setAuthor({ name: author.tag, iconUrl: author.avatarURL() }),
);
Expand Down
5 changes: 3 additions & 2 deletions src/commands/music/seek.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandContext, Declare, LocalesT, type OKFunction, Options, createStringOption } from "seyfert";
import { Command, type CommandContext, Declare, LocalesT, Middlewares, type OKFunction, Options, createStringOption } from "seyfert";
import { StelleOptions } from "#stelle/decorators";

import { EmbedColors } from "seyfert/lib/common/index.js";
Expand Down Expand Up @@ -33,9 +33,10 @@ const options = {
contexts: ["Guild"],
aliases: ["sk"],
})
@StelleOptions({ cooldown: 5, category: StelleCategory.Music, checkPlayer: true, inVoice: true, sameVoice: true, checkNodes: true })
@StelleOptions({ cooldown: 5, category: StelleCategory.Music })
@Options(options)
@LocalesT("locales.seek.name", "locales.seek.description")
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer"])
export default class SeekCommand extends Command {
public override async run(ctx: CommandContext<typeof options>) {
const { client, options, guildId } = ctx;
Expand Down
8 changes: 2 additions & 6 deletions src/commands/music/shuffle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandContext, Declare } from "seyfert";
import { Command, type CommandContext, Declare, Middlewares } from "seyfert";
import { StelleOptions } from "#stelle/decorators";
import { StelleCategory } from "#stelle/types";

Expand All @@ -12,12 +12,8 @@ import { StelleCategory } from "#stelle/types";
@StelleOptions({
cooldown: 5,
category: StelleCategory.Music,
checkNodes: true,
checkPlayer: true,
checkQueue: true,
inVoice: true,
sameVoice: true,
})
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer", "checkQueue"])
export default class ShuffleCommand extends Command {
public override async run(ctx: CommandContext) {
const { client } = ctx;
Expand Down
8 changes: 2 additions & 6 deletions src/commands/music/skip.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandContext, Declare, LocalesT, Options, createIntegerOption } from "seyfert";
import { Command, type CommandContext, Declare, LocalesT, Middlewares, Options, createIntegerOption } from "seyfert";
import { StelleOptions } from "#stelle/decorators";
import { StelleCategory } from "#stelle/types";

Expand All @@ -22,14 +22,10 @@ const options = {
@StelleOptions({
cooldown: 5,
category: StelleCategory.Music,
checkPlayer: true,
inVoice: true,
sameVoice: true,
checkNodes: true,
checkQueue: true,
})
@Options(options)
@LocalesT("locales.skip.name", "locales.skip.description")
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer", "checkQueue"])
export default class SkipCommand extends Command {
public override async run(ctx: CommandContext<typeof options>) {
const { client, options, guildId } = ctx;
Expand Down
5 changes: 3 additions & 2 deletions src/commands/music/stop.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandContext, Declare, LocalesT } from "seyfert";
import { Command, type CommandContext, Declare, LocalesT, Middlewares } from "seyfert";
import { StelleOptions } from "#stelle/decorators";
import { StelleCategory } from "#stelle/types";

Expand All @@ -9,8 +9,9 @@ import { StelleCategory } from "#stelle/types";
contexts: ["Guild"],
aliases: ["sp"],
})
@StelleOptions({ cooldown: 5, category: StelleCategory.Music, checkPlayer: true, inVoice: true, sameVoice: true, checkNodes: true })
@StelleOptions({ cooldown: 5, category: StelleCategory.Music })
@LocalesT("locales.stop.name", "locales.stop.description")
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer"])
export default class StopCommand extends Command {
public override async run(ctx: CommandContext) {
const { client, guildId } = ctx;
Expand Down
5 changes: 3 additions & 2 deletions src/commands/music/volume.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandContext, Declare, LocalesT, Options, createIntegerOption } from "seyfert";
import { Command, type CommandContext, Declare, LocalesT, Middlewares, Options, createIntegerOption } from "seyfert";
import { StelleOptions } from "#stelle/decorators";
import { StelleCategory } from "#stelle/types";

Expand All @@ -22,9 +22,10 @@ const options = {
contexts: ["Guild"],
aliases: ["v", "vol"],
})
@StelleOptions({ cooldown: 5, category: StelleCategory.Music, checkPlayer: true, inVoice: true, sameVoice: true, checkNodes: true })
@StelleOptions({ cooldown: 5, category: StelleCategory.Music })
@Options(options)
@LocalesT("locales.volume.name", "locales.volume.description")
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer"])
export default class VolumeCommand extends Command {
public override async run(ctx: CommandContext<typeof options>) {
const { client, options, guildId } = ctx;
Expand Down
6 changes: 2 additions & 4 deletions src/components/autoplay.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { ActionRow, Button, ComponentCommand, type ComponentContext } from "seyfert";
import { StelleOptions } from "#stelle/decorators";

import { ActionRow, Button, ComponentCommand, type ComponentContext, Middlewares } from "seyfert";
import { type APIButtonComponentWithCustomId, ButtonStyle, ComponentType } from "seyfert/lib/types/index.js";

import { getAutoplayState } from "#stelle/utils/functions/utils.js";

@StelleOptions({ inVoice: true, sameVoice: true, checkPlayer: true, moreTracks: true, checkNodes: true })
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer", "checkTracks"])
export default class AutoplayComponent extends ComponentCommand {
componentType = "Button" as const;

Expand Down
5 changes: 2 additions & 3 deletions src/components/loop.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { ActionRow, Button, ComponentCommand, type ComponentContext } from "seyfert";
import { StelleOptions } from "#stelle/decorators";
import { ActionRow, Button, ComponentCommand, type ComponentContext, Middlewares } from "seyfert";

import { type APIButtonComponentWithCustomId, ButtonStyle, ComponentType } from "seyfert/lib/types/index.js";
import { getLoopState } from "#stelle/utils/functions/utils.js";

@StelleOptions({ inVoice: true, sameVoice: true, checkPlayer: true, checkNodes: true })
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer"])
export default class ToggleLoopComponent extends ComponentCommand {
componentType = "Button" as const;

Expand Down
5 changes: 2 additions & 3 deletions src/components/pause.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { ActionRow, Button, ComponentCommand, type ComponentContext } from "seyfert";
import { StelleOptions } from "#stelle/decorators";
import { ActionRow, Button, ComponentCommand, type ComponentContext, Middlewares } from "seyfert";

import { type APIButtonComponentWithCustomId, ButtonStyle, ComponentType } from "seyfert/lib/types/index.js";
import { getPauseState } from "#stelle/utils/functions/utils.js";

@StelleOptions({ inVoice: true, sameVoice: true, checkPlayer: true, checkNodes: true })
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer"])
export default class PauseTrackComponent extends ComponentCommand {
componentType = "Button" as const;

Expand Down
5 changes: 2 additions & 3 deletions src/components/previous.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { ComponentCommand, type ComponentContext } from "seyfert";
import { StelleOptions } from "#stelle/decorators";
import { ComponentCommand, type ComponentContext, Middlewares } from "seyfert";

import { EmbedColors } from "seyfert/lib/common/index.js";
import { MessageFlags } from "seyfert/lib/types/index.js";

@StelleOptions({ inVoice: true, sameVoice: true, checkPlayer: true, checkNodes: true })
@Middlewares(["checkNodes", "checkVoiceChannel", "checkBotVoiceChannel", "checkPlayer"])
export default class PreviousTrackComponent extends ComponentCommand {
componentType = "Button" as const;

Expand Down
Loading

0 comments on commit 078fa8b

Please sign in to comment.