Skip to content
Closed
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,29 @@ import { GatewayIntentBits, Partials } from "discord.js";

await client.connect(process.env.TOKEN);
})();

// If you need internationalisation:
import { initTranslations } from "@stelliajs/framework";

await use(Backend).init(
{
lng: StelliaLocale.English, // StelliaLocale is an enum with all the supported languages by Discord
backend: {
// With namespace: path.join(import.meta.dirname, "../locales/{{lng}}/{{ns}}.json")
loadPath: path.join(import.meta.dirname, "../locales/{{lng}}.json")
},
fallbackLng: StelliaLocale.English,
supportedLngs: Object.values(AmariLocale),
preload: Object.values(AmariLocale)
// ns: ["common", "commands", "errors"]
},
(error) => {
if (error) {
console.error(error);
}
}
);
initTranslations(i18next);
```

#### Environment model
Expand Down
3 changes: 2 additions & 1 deletion eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default defineConfig([
}
},
rules: {
"import-x/namespace": "off",
"key-spacing": ["error", { beforeColon: false, afterColon: true }],
"import-x/no-unresolved": "error",
"import-x/no-duplicates": "error",
"import-x/newline-after-import": ["error", { count: 1 }],
Expand All @@ -49,6 +49,7 @@ export default defineConfig([
}
}
],
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/consistent-type-imports": [
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@stelliajs/framework",
"version": "1.7.3",
"version": "1.8.0",
"type": "module",
"description": "A framework for simplifying the creation of discord bots",
"author": "Tweenty_",
"license": "ISC",
"packageManager": "pnpm@11.1.3",
"packageManager": "pnpm@11.8.0",
"engines": {
"node": ">=24.0.0"
},
Expand Down Expand Up @@ -37,23 +37,23 @@
},
"peerDependencies": {
"discord.js": "^14.26.4",
"i18next": "26.2.0"
"i18next": "26.3.1"
},
"dependencies": {
"log-symbols": "^7.0.1"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"discord.js": "^14.26.4",
"eslint": "^10.4.0",
"eslint": "^10.5.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-import-resolver-typescript": "^4.4.5",
"eslint-plugin-import-x": "^4.16.2",
"globals": "^17.6.0",
"jiti": "^2.7.0",
"prettier": "^3.8.3",
"tsdown": "^0.22.0",
"prettier": "^3.8.4",
"tsdown": "^0.22.3",
"typescript": "^6.0.3",
"typescript-eslint": "^8.59.4"
"typescript-eslint": "^8.61.1"
}
}
Loading
Loading