Skip to content

Commit ca3017d

Browse files
authored
Merge branch 'main' into feat/add-permissions-for-ci-workflow
2 parents af5c08a + 353871d commit ca3017d

5 files changed

Lines changed: 96 additions & 94 deletions

File tree

compose.dev.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
services:
2+
influx:
3+
command: 'influxd run --bolt-path /var/lib/influxdb2/influxd.bolt --engine-path /var/lib/influxdb2/engine --store bolt'
4+
container_name: influxdb
5+
image: 'influxdb:2.7-alpine'
6+
networks:
7+
- wolfstar
8+
ports:
9+
- '8285:8086'
10+
restart: always
11+
volumes:
12+
- 'influx-data:/var/lib/influxdb2'
13+
logging:
14+
options:
15+
max-size: '10m'
16+
max-file: '3'
17+
18+
postgres2:
19+
container_name: postgres2
20+
image: 'postgres:15-alpine'
21+
networks:
22+
- wolfstar
23+
ports:
24+
- '5432:5432'
25+
restart: always
26+
volumes:
27+
- 'postgres-data:/var/lib/postgresql/data'
28+
environment:
29+
- POSTGRES_USER=postgres
30+
- POSTGRES_PASSWORD=postgres
31+
- POSTGRES_DB=wolfstar
32+
logging:
33+
options:
34+
max-size: '20m'
35+
max-file: '3'
36+
healthcheck:
37+
test: ['CMD-SHELL', 'pg_isready']
38+
interval: 30s
39+
timeout: 60s
40+
retries: 5
41+
start_period: 80s
42+
43+
redis:
44+
command: 'redis-server --port 8287 --requirepass redis'
45+
container_name: redis
46+
image: 'redis:alpine'
47+
networks:
48+
- wolfstar
49+
ports:
50+
- '8287:8287'
51+
restart: always
52+
logging:
53+
options:
54+
max-size: '20m'
55+
max-file: '3'
56+
57+
wolfstar:
58+
build: ./
59+
container_name: wolfstar
60+
depends_on:
61+
- influx
62+
- postgres2
63+
env_file:
64+
- src/.env.development
65+
- src/.env.development.local
66+
image: ghcr.io/wolfstar-project/wolfstar:latest
67+
networks:
68+
- wolfstar
69+
ports:
70+
- '8282:8282'
71+
restart: always
72+
tty: true
73+
logging:
74+
options:
75+
max-size: '1g'
76+
max-file: '3'
77+
78+
volumes:
79+
postgres-data:
80+
influx-data:
81+
82+
networks:
83+
wolfstar:

compose.yaml

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/arguments/language.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { LanguageKeys } from '#lib/i18n/languageKeys';
22
import { Argument } from '@sapphire/framework';
3-
import type { LocaleString } from 'discord.js';
3+
import type { Locale } from 'discord.js';
44

5-
export class UserArgument extends Argument<LocaleString> {
5+
export class UserArgument extends Argument<Locale> {
66
public run(parameter: string, context: Argument.Context) {
77
const { languages } = this.container.i18n;
8-
if (languages.has(parameter)) return this.ok(parameter as LocaleString);
8+
if (languages.has(parameter)) return this.ok(parameter as Locale);
99
return this.error({ parameter, identifier: LanguageKeys.Arguments.Language, context: { ...context, possibles: [...languages.keys()] } });
1010
}
1111
}

src/lib/i18n/translate.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { DecoratorIdentifiers } from '@sapphire/decorators';
44
import { Identifiers, container } from '@sapphire/framework';
55
import type { InternationalizationContext, TFunction } from '@sapphire/plugin-i18next';
66
import type { Nullish } from '@sapphire/utilities';
7-
import type { Interaction, LocaleString } from 'discord.js';
7+
import type { Interaction, Locale } from 'discord.js';
88

99
export function translate(identifier: string): string {
1010
switch (identifier) {
@@ -120,11 +120,11 @@ export function resolveT(t: TResolvable): TFunction {
120120
* @param locale The locale to get the translation function for.
121121
* @returns The translation function for the specified locale.
122122
*/
123-
export function getT(locale?: LocaleString | string | Nullish) {
123+
export function getT(locale?: Locale | string | Nullish) {
124124
return container.i18n.getT(locale ?? 'en-US');
125125
}
126126

127-
export function getSupportedLanguageName(interaction: Interaction): LocaleString {
127+
export function getSupportedLanguageName(interaction: Interaction): Locale {
128128
if (interaction.guildLocale && container.i18n.languages.has(interaction.guildLocale)) return interaction.guildLocale;
129129
return 'en-US';
130130
}
@@ -133,7 +133,7 @@ export function getSupportedLanguageT(interaction: Interaction): TFunction {
133133
return getT(getSupportedLanguageName(interaction));
134134
}
135135

136-
export function getSupportedUserLanguageName(interaction: Interaction): LocaleString {
136+
export function getSupportedUserLanguageName(interaction: Interaction): Locale {
137137
if (container.i18n.languages.has(interaction.locale)) return interaction.locale;
138138
return getSupportedLanguageName(interaction);
139139
}
@@ -146,10 +146,10 @@ export function getSupportedUserLanguageT(interaction: Interaction): TFunction {
146146
* Fetches the language for the given {@link InternationalizationContext}.
147147
* If the language cannot be fetched, defaults to 'en-US'.
148148
* @param context The InternationalizationContext to fetch the language for.
149-
* @returns The fetched language as a {@link LocaleString}.
149+
* @returns The fetched language as a {@link Locale}.
150150
*/
151151
export async function fetchLanguage(context: InternationalizationContext) {
152-
return (await container.i18n.fetchLanguage(context))! as LocaleString;
152+
return (await container.i18n.fetchLanguage(context))! as Locale;
153153
}
154154

155155
/**

src/routes/commands.get.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import { seconds } from '#utils/common';
66
import type { Command } from '@sapphire/framework';
77
import { Route } from '@sapphire/plugin-api';
88
import type { TFunction } from '@sapphire/plugin-i18next';
9-
import type { LocaleString } from 'discord.js';
9+
import type { Locale } from 'discord.js';
1010

1111
export class UserRoute extends Route {
1212
@ratelimit(seconds(2), 2)
1313
public run(request: Route.Request, response: Route.Response) {
1414
const { lang, category } = request.query;
1515
const commands = this.container.stores.get('commands');
16-
const language = getT(lang as LocaleString);
16+
const language = getT(lang as Locale);
1717
const filtered = (category ? commands.filter((cmd) => cmd.category === category) : commands).filter(
1818
(cmd) => (cmd as WolfCommand).permissionLevel < PermissionLevels.BotOwner
1919
);
@@ -25,6 +25,8 @@ export class UserRoute extends Route {
2525
const command = cmd as WolfCommand;
2626
return {
2727
category: command.category,
28+
subCategory: command.subCategory,
29+
alias: command.aliases,
2830
description: t(command.description),
2931
extendedHelp: t(command.detailedDescription, { prefix: process.env.CLIENT_PREFIX }),
3032
guarded: command.guarded,

0 commit comments

Comments
 (0)