Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2e46378
Merge pull request #68 from StelliaJS/develop
Tweentyy Sep 24, 2025
c254e26
Merge pull request #70 from StelliaJS/develop
Tweentyy Sep 24, 2025
9e86fef
Merge pull request #72 from StelliaJS/develop
Tweentyy Sep 24, 2025
ab361ea
Merge pull request #75 from StelliaJS/develop
Tweentyy Sep 25, 2025
57aa639
Merge pull request #78 from StelliaJS/develop
Tweentyy Sep 26, 2025
2414eb8
Merge pull request #80 from StelliaJS/develop
Tweentyy Oct 25, 2025
ff286f5
Merge pull request #82 from StelliaJS/develop
Tweentyy Oct 25, 2025
f3bcee8
feat(CI): upgrade versions
Tweentyy Dec 8, 2025
7d6fa5e
Merge pull request #84 from StelliaJS/feat/ci-improvement
Tweentyy Dec 8, 2025
7919786
Merge pull request #85 from StelliaJS/develop
Tweentyy Dec 8, 2025
8a10e02
Merge pull request #87 from StelliaJS/develop
Tweentyy Apr 1, 2026
db6aa58
refactor(managers): use generic type
Tweentyy Apr 6, 2026
9619e43
refactor(date): remove deprecated TimestampStyles
Tweentyy Apr 6, 2026
7ae81b0
bump(deps): latest Djs version + new tsconfig for TS 6
Tweentyy Apr 6, 2026
eb6a692
fix: sonar
Tweentyy Apr 6, 2026
f5ebb8f
fix(file): more generic file path
Tweentyy Apr 6, 2026
cd13262
fix(managers): remove types
Tweentyy Apr 6, 2026
d7e6ba5
refactor: remove unused imports
Tweentyy Apr 7, 2026
4b5f39b
refactor(translation): improve typing
Tweentyy Apr 7, 2026
dcd3d0d
fix(event): ...args on guildsConfiguration
Tweentyy Apr 7, 2026
7788a85
feat(ci): add tag workflow
Tweentyy Apr 7, 2026
6fece03
release: 1.6.0-dev-2
Tweentyy Apr 7, 2026
8115d43
feat(ci): add permissions write
Tweentyy Apr 7, 2026
c9789d4
feat(ci): add permissions write
Tweentyy Apr 7, 2026
3515817
refactor(ci): manually create new dev version
Tweentyy Apr 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Tag dev version
on:
workflow_dispatch:

jobs:
tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5

- name: Create dev tag
run: |
SHA=$(git rev-parse --short HEAD)
VERSION=$(jq -r '.version' package.json)
TAG="v${VERSION}-dev-${SHA}"
git tag "$TAG"
git push origin "$TAG"
10 changes: 4 additions & 6 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ jobs:
update-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v3
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
version: 10.17.1
- uses: actions/setup-node@v5
with:
node-version: 22
node-version: "24.x"
- name: Update dependencies
run: |
pnpm install
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stelliajs/framework",
"version": "1.6.0-dev-1",
"version": "1.6.0-dev-2",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
Expand All @@ -23,7 +23,7 @@
"framework"
],
"dependencies": {
"discord.js": "^14.26.0",
"discord.js": "^14.26.2",
"i18next": "^26.0.3",
"log-symbols": "^7.0.1"
},
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

33 changes: 13 additions & 20 deletions src/client/StelliaUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,16 @@ import {
import { type StelliaClient } from "@client/index.js";
import { DISCORD_API_VERSION } from "@constants/index.js";
import {
type AutoCompleteStructure,
type AutoCompleteStructureWithGuildConfiguration,
type AutoCompleteStructureWithoutGuildConfiguration,
type ButtonStructure,
type ButtonStructureWithGuildConfiguration,
type ButtonStructureWithoutGuildConfiguration,
type CommandStructure,
type CommandStructureWithGuildConfiguration,
type CommandStructureWithoutGuildConfiguration,
type ContextMenuStructure,
type ContextMenuStructureWithGuildConfiguration,
type ContextMenuStructureWithoutGuildConfiguration,
type ModalStructure,
type ModalStructureWithGuildConfiguration,
type ModalStructureWithoutGuildConfiguration,
type SelectMenuStructure,
type SelectMenuStructureWithGuildConfiguration,
type SelectMenuStructureWithoutGuildConfiguration
} from "@structures/index.js";
Expand Down Expand Up @@ -63,8 +57,8 @@ export class StelliaUtils {
}

public initializeCommands = async (): Promise<void> => {
const commands = this.client.managers.commands?.getAll<CommandStructure>().values();
const contextMenus = this.client.managers.contextMenus?.getAll<ContextMenuStructure>().values();
const commands = this.client.managers.commands?.getAll().values();
const contextMenus = this.client.managers.contextMenus?.getAll().values();
const applicationCommands = [...(commands || []), ...(contextMenus || [])].map((item) => item.data.command);

if (this.client.isReady()) {
Expand Down Expand Up @@ -111,8 +105,7 @@ export class StelliaUtils {
private async initializeGuildsConfiguration(): Promise<void> {
if (this.client.environment?.areGuildsConfigurationEnabled) {
try {
const guildsConfiguration = await this.client.getGuildsConfiguration();
this.guildsConfiguration = guildsConfiguration;
this.guildsConfiguration = await this.client.getGuildsConfiguration();
logger.success("Guilds configuration loaded successfully for interactions");
} catch (error: any) {
logger.errorWithInformation("Error while loading guilds configuration", error);
Expand All @@ -126,7 +119,7 @@ export class StelliaUtils {
const autoCompleteManager = this.client.managers.autoCompletes;
if (!autoCompleteManager) return;

const autoComplete = autoCompleteManager.getByCustomId<AutoCompleteStructure>(autoCompleteInteraction.commandName);
const autoComplete = autoCompleteManager.getByCustomId(autoCompleteInteraction.commandName);
if (!autoComplete) return;

if (this.client.environment?.areGuildsConfigurationEnabled) {
Expand All @@ -149,8 +142,8 @@ export class StelliaUtils {
if (!buttonManager) return;

const button =
buttonManager.getByCustomId<ButtonStructure>(buttonInteraction.customId) ||
buttonManager.getByRegex<ButtonStructure>(buttonInteraction.customId);
buttonManager.getByCustomId(buttonInteraction.customId) ||
buttonManager.getByRegex(buttonInteraction.customId);
if (!button) return;

if (button.data.reply.autoDefer && !buttonInteraction.deferred) {
Expand All @@ -176,7 +169,7 @@ export class StelliaUtils {
const commandManager = this.client.managers.commands;
if (!commandManager) return;

const command = commandManager.getByCustomId<CommandStructure>(commandInteraction.commandName);
const command = commandManager.getByCustomId(commandInteraction.commandName);
if (!command) return;

if (command.data.reply.autoDefer && !commandInteraction.deferred) {
Expand Down Expand Up @@ -218,8 +211,8 @@ export class StelliaUtils {
if (!modalManager) return;

const modal =
modalManager.getByCustomId<ModalStructure>(modalInteraction.customId) ||
modalManager.getByRegex<ModalStructure>(modalInteraction.customId);
modalManager.getByCustomId(modalInteraction.customId) ||
modalManager.getByRegex(modalInteraction.customId);
if (!modal) return;

if (modal.data.reply.autoDefer && !modalInteraction.deferred) {
Expand All @@ -246,8 +239,8 @@ export class StelliaUtils {
if (!selectMenuManager) return;

const selectMenu =
selectMenuManager.getByCustomId<SelectMenuStructure>(selectMenuInteraction.customId) ||
selectMenuManager.getByRegex<SelectMenuStructure>(selectMenuInteraction.customId);
selectMenuManager.getByCustomId(selectMenuInteraction.customId) ||
selectMenuManager.getByRegex(selectMenuInteraction.customId);
if (!selectMenu) return;

if (selectMenu.data.reply.autoDefer && !selectMenuInteraction.deferred) {
Expand All @@ -272,7 +265,7 @@ export class StelliaUtils {
const contextMenuManager = this.client.managers.contextMenus;
if (!contextMenuManager) return;

const messageContextMenu = contextMenuManager.getByCustomId<ContextMenuStructure>(interaction.commandName);
const messageContextMenu = contextMenuManager.getByCustomId(interaction.commandName);
if (!messageContextMenu) return;

if (messageContextMenu.data.reply.autoDefer && !interaction.deferred) {
Expand All @@ -297,7 +290,7 @@ export class StelliaUtils {
const contextMenuManager = this.client.managers.contextMenus;
if (!contextMenuManager) return;

const userContextMenu = contextMenuManager.getByCustomId<ContextMenuStructure>(interaction.commandName);
const userContextMenu = contextMenuManager.getByCustomId(interaction.commandName);
if (!userContextMenu) return;

if (userContextMenu.data.reply.autoDefer && !interaction.deferred) {
Expand Down
18 changes: 8 additions & 10 deletions src/managers/AutoCompleteManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type AutoCompleteStructure } from "@structures/index.js";
import { type InteractionCustomId, type StructureCustomId } from "@typescript/index.js";
import { requiredFiles } from "@utils/index.js";

export class AutoCompleteManager extends BaseManager {
export class AutoCompleteManager extends BaseManager<AutoCompleteStructure> {
private interactions: Collection<StructureCustomId, AutoCompleteStructure> = new Collection();

private constructor(client: StelliaClient, directoryPath: string) {
Expand All @@ -25,25 +25,23 @@ export class AutoCompleteManager extends BaseManager {
this.setManagerLoaded();
}

public getByCustomId<AutoCompleteStructure>(id: InteractionCustomId): AutoCompleteStructure | null {
const autoComplete = (this.interactions.get(id) as AutoCompleteStructure) ?? null;
return autoComplete;
public getByCustomId(id: InteractionCustomId): AutoCompleteStructure | null {
return this.interactions.get(id) ?? null;
}

public getByRegex<AutoCompleteStructure>(id: InteractionCustomId): AutoCompleteStructure | null {
let autoComplete = null;
public getByRegex(id: InteractionCustomId): AutoCompleteStructure | null {
let autoComplete: AutoCompleteStructure | null = null;
for (const [customId, action] of this.interactions.entries()) {
if (customId instanceof RegExp && customId.test(id)) {
autoComplete = action as AutoCompleteStructure;
autoComplete = action;
break;
}
}

return autoComplete;
}

public getAll<AutoCompleteStructure>(): Collection<StructureCustomId, AutoCompleteStructure> {
const autoCompletes = this.interactions as Collection<StructureCustomId, AutoCompleteStructure>;
return autoCompletes;
public getAll(): Collection<StructureCustomId, AutoCompleteStructure> {
return this.interactions;
}
}
8 changes: 4 additions & 4 deletions src/managers/BaseManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface ManagerOptions {
directoryPath: string;
}

export abstract class BaseManager {
export abstract class BaseManager<TStructure extends AnyInteractionStructure> {
public readonly client: StelliaClient;
public readonly directoryPath: string;
private isLoaded = false;
Expand All @@ -26,7 +26,7 @@ export abstract class BaseManager {
}

public abstract loadData(): Promise<void>;
public abstract getByCustomId<InteractionStructure extends AnyInteractionStructure>(id: InteractionCustomId): InteractionStructure | null;
public abstract getByRegex<InteractionStructure extends AnyInteractionStructure>(id: InteractionCustomId): InteractionStructure | null;
public abstract getAll<InteractionStructure extends AnyInteractionStructure>(): Collection<StructureCustomId, InteractionStructure>;
public abstract getByCustomId(id: InteractionCustomId): TStructure | null;
public abstract getByRegex(id: InteractionCustomId): TStructure | null;
public abstract getAll(): Collection<StructureCustomId, TStructure>;
}
18 changes: 8 additions & 10 deletions src/managers/ButtonManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type ButtonStructure } from "@structures/index.js";
import { type InteractionCustomId, type StructureCustomId } from "@typescript/index.js";
import { requiredFiles } from "@utils/index.js";

export class ButtonManager extends BaseManager {
export class ButtonManager extends BaseManager<ButtonStructure> {
public interactions: Collection<StructureCustomId, ButtonStructure> = new Collection();

private constructor(client: StelliaClient, directoryPath: string) {
Expand All @@ -25,25 +25,23 @@ export class ButtonManager extends BaseManager {
this.setManagerLoaded();
}

public getByCustomId<ButtonStructure>(id: InteractionCustomId): ButtonStructure | null {
const button = (this.interactions.get(id) as ButtonStructure) ?? null;
return button;
public getByCustomId(id: InteractionCustomId): ButtonStructure | null {
return this.interactions.get(id) ?? null;
}

public getByRegex<ButtonStructure>(id: InteractionCustomId): ButtonStructure | null {
let button = null;
public getByRegex(id: InteractionCustomId): ButtonStructure | null {
let button: ButtonStructure | null = null;
for (const [customId, action] of this.interactions.entries()) {
if (customId instanceof RegExp && customId.test(id)) {
button = action as ButtonStructure;
button = action;
break;
}
}

return button;
}

public getAll<ButtonStructure>(): Collection<StructureCustomId, ButtonStructure> {
const buttons = this.interactions as Collection<StructureCustomId, ButtonStructure>;
return buttons;
public getAll(): Collection<StructureCustomId, ButtonStructure> {
return this.interactions;
}
}
18 changes: 8 additions & 10 deletions src/managers/CommandManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type CommandStructure } from "@structures/index.js";
import { type InteractionCustomId, type StructureCustomId } from "@typescript/index.js";
import { requiredFiles } from "@utils/index.js";

export class CommandManager extends BaseManager {
export class CommandManager extends BaseManager<CommandStructure> {
private interactions: Collection<StructureCustomId, CommandStructure> = new Collection();

private constructor(client: StelliaClient, directoryPath: string) {
Expand All @@ -25,25 +25,23 @@ export class CommandManager extends BaseManager {
this.setManagerLoaded();
}

public getByCustomId<CommandStructure>(id: InteractionCustomId): CommandStructure | null {
const command = (this.interactions.get(id) as CommandStructure) ?? null;
return command;
public getByCustomId(id: InteractionCustomId): CommandStructure | null {
return this.interactions.get(id) ?? null;
}

public getByRegex<CommandStructure>(id: InteractionCustomId): CommandStructure | null {
let command = null;
public getByRegex(id: InteractionCustomId): CommandStructure | null {
let command: CommandStructure | null = null;
for (const [customId, action] of this.interactions.entries()) {
if (customId instanceof RegExp && customId.test(id)) {
command = action as CommandStructure;
command = action;
break;
}
}

return command;
}

public getAll<CommandStructure>(): Collection<StructureCustomId, CommandStructure> {
const commands = this.interactions as Collection<StructureCustomId, CommandStructure>;
return commands;
public getAll(): Collection<StructureCustomId, CommandStructure> {
return this.interactions;
}
}
18 changes: 8 additions & 10 deletions src/managers/ContextMenuManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type ContextMenuStructure } from "@structures/index.js";
import { type InteractionCustomId, type StructureCustomId } from "@typescript/index.js";
import { requiredFiles } from "@utils/index.js";

export class ContextMenuManager extends BaseManager {
export class ContextMenuManager extends BaseManager<ContextMenuStructure> {
private interactions: Collection<StructureCustomId, ContextMenuStructure> = new Collection();

private constructor(client: StelliaClient, directoryPath: string) {
Expand All @@ -25,25 +25,23 @@ export class ContextMenuManager extends BaseManager {
this.setManagerLoaded();
}

public getByCustomId<ContextMenuStructure>(id: InteractionCustomId): ContextMenuStructure | null {
const contextMenu = (this.interactions.get(id) as ContextMenuStructure) ?? null;
return contextMenu;
public getByCustomId(id: InteractionCustomId): ContextMenuStructure | null {
return this.interactions.get(id) ?? null;
}

public getByRegex<ContextMenuStructure>(id: InteractionCustomId): ContextMenuStructure | null {
let contextMenu = null;
public getByRegex(id: InteractionCustomId): ContextMenuStructure | null {
let contextMenu: ContextMenuStructure | null = null;
for (const [customId, action] of this.interactions.entries()) {
if (customId instanceof RegExp && customId.test(id)) {
contextMenu = action as ContextMenuStructure;
contextMenu = action;
break;
}
}

return contextMenu;
}

public getAll<ContextMenuStructure>(): Collection<StructureCustomId, ContextMenuStructure> {
const contextMenus = this.interactions as Collection<StructureCustomId, ContextMenuStructure>;
return contextMenus;
public getAll(): Collection<StructureCustomId, ContextMenuStructure> {
return this.interactions;
}
}
Loading
Loading