Skip to content

Commit

Permalink
refacto: folder structure with new core folder
Browse files Browse the repository at this point in the history
  • Loading branch information
barthofu committed Jul 12, 2023
1 parent 64dca02 commit 4f92837
Show file tree
Hide file tree
Showing 93 changed files with 776 additions and 41 deletions.
32 changes: 16 additions & 16 deletions .swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@
"baseUrl": "./",
"paths": {

"@decorators": ["src/utils/decorators"],
"@decorators/*": ["src/plugins/*/utils/decorators"],
"@decorators": ["src/core/utils/decorators"],
"@decorators/*": ["src/plugins/*/core/utils/decorators"],

"@errors": ["src/utils/errors"],
"@errors/*": ["src/plugins/*/utils/errors"],
"@errors": ["src/core/utils/errors"],
"@errors/*": ["src/plugins/*/core/utils/errors"],

"@entities": ["src/entities"],
"@entities/*": ["src/plugins/*/entities"],
"@entities": ["src/core/entities"],
"@entities/*": ["src/plugins/*/core/entities"],

"@guards": ["src/guards"],
"@guards/*": ["src/plugins/*/guards"],
"@guards": ["src/core/guards"],
"@guards/*": ["src/plugins/*/core/guards"],

"@services": ["src/services"],
"@services/*": ["src/plugins/*/services"],
"@services": ["src/core/services"],
"@services/*": ["src/plugins/*/core/services"],

"@i18n": ["src/i18n"],
"@i18n/*": ["src/plugins/*/i18n"],
"@i18n": ["src/core/i18n"],
"@i18n/*": ["src/plugins/*/core/i18n"],

"@configs": ["src/configs"],
"@configs/*": ["src/plugins/*/configs"],

"@utils/classes": ["src/utils/classes"],
"@utils/classes/*": ["src/plugins/*/utils/classes"],
"@utils/classes": ["src/core/utils/classes"],
"@utils/classes/*": ["src/plugins/*/core/utils/classes"],

"@utils/functions": ["src/utils/functions"],
"@utils/functions/*": ["src/plugins/*/utils/functions"],
"@utils/functions": ["src/core/utils/functions"],
"@utils/functions/*": ["src/plugins/*/core/utils/functions"],

"@api/controllers": ["src/api/controllers"],
"@api/controllers/*": ["src/plugins/*/api/controllers"],
Expand Down
4 changes: 2 additions & 2 deletions src/commands/General/help.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Category } from "@discordx/utilities"
import { ActionRowBuilder, APISelectMenuOption, CommandInteraction, EmbedBuilder, inlineCode, StringSelectMenuBuilder, StringSelectMenuInteraction } from "discord.js"
import { ActionRowBuilder, APISelectMenuOption, CommandInteraction, EmbedBuilder, StringSelectMenuBuilder, StringSelectMenuInteraction } from "discord.js"
import { Client, MetadataStorage, SelectMenuComponent } from "discordx"

import { Discord, Slash } from "@decorators"
import { chunkArray, getColor, resolveGuild, validString } from "@utils/functions"
import { TranslationFunctions } from "src/i18n/i18n-types"
import { TranslationFunctions } from "src/core/i18n/i18n-types"

@Discord()
@Category('General')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
71 changes: 71 additions & 0 deletions src/core/i18n/en/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* eslint-disable */
import type { BaseTranslation } from '../i18n-types'

const en = {
GUARDS: {
DISABLED_COMMAND: 'This command is currently disabled.',
MAINTENANCE: 'This bot is currently in maintenance mode.',
GUILD_ONLY: 'This command can only be used in a server.',
NSFW: 'This command can only be used in a NSFW channel.',
},
ERRORS: {
UNKNOWN: 'An unknown error occurred.',
},
SHARED: {
NO_COMMAND_DESCRIPTION: 'No description provided.',
},
COMMANDS: {
INVITE: {
DESCRIPTION: 'Invite the bot to your server!',
EMBED: {
TITLE: 'Invite me on your server!',
DESCRIPTION: '[Click here]({link}) to invite me!',
},
},
PREFIX: {
NAME: 'prefix',
DESCRIPTION: 'Change the prefix of the bot.',
OPTIONS: {
PREFIX: {
NAME: 'new_prefix',
DESCRIPTION: 'The new prefix of the bot.',
},
},
EMBED: {
DESCRIPTION: 'Prefix changed to `{prefix:string}`.',
},
},
MAINTENANCE: {
DESCRIPTION: 'Set the maintenance mode of the bot.',
EMBED: {
DESCRIPTION: 'Maintenance mode set to `{state:string}`.',
},
},
STATS: {
DESCRIPTION: 'Get some stats about the bot.',
HEADERS: {
COMMANDS: 'Commands',
GUILDS: 'Guild',
ACTIVE_USERS: 'Active Users',
USERS: 'Users',
},
},
HELP: {
DESCRIPTION: 'Get global help about the bot and its commands',
EMBED: {
TITLE: 'Help panel',
CATEGORY_TITLE: '{category:string} Commands',
},
SELECT_MENU: {
TITLE: 'Select a category',
CATEGORY_DESCRIPTION: '{category:string} commands',
},
},
PING: {
DESCRIPTION: 'Pong!',
MESSAGE: '{member:string} Pong! The message round-trip took {time:number}ms.{heartbeat:string}',
},
},
} satisfies BaseTranslation

export default en
11 changes: 11 additions & 0 deletions src/core/i18n/formatters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { FormattersInitializer } from "typesafe-i18n"
import type { Locales, Formatters } from "./i18n-types"

export const initFormatters: FormattersInitializer<Locales, Formatters> = (locale: Locales) => {

const formatters: Formatters = {
// add your formatter functions here
}

return formatters
}
71 changes: 71 additions & 0 deletions src/core/i18n/fr/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* eslint-disable */
import type { Translation } from '../i18n-types'

const fr = {
GUARDS: {
DISABLED_COMMAND: 'Cette commande est désactivée.',
MAINTENANCE: 'Ce bot est en mode maintenance.',
GUILD_ONLY: "Cette commande ne peut être utilisée qu'en serveur.",
NSFW: 'Cette commande ne peut être utilisée que dans un salon NSFW.',
},
ERRORS: {
UNKNOWN: 'Une erreur est survenue.',
},
SHARED: {
NO_COMMAND_DESCRIPTION: 'Aucune description fournie.',
},
COMMANDS: {
INVITE: {
DESCRIPTION: 'Invitez le bot sur votre serveur!',
EMBED: {
TITLE: 'Invite moi sur ton serveur!',
DESCRIPTION: "[Clique ici]({link}) pour m'inviter!",
},
},
PREFIX: {
NAME: 'prefixe',
DESCRIPTION: 'Change le préfix du bot.',
OPTIONS: {
PREFIX: {
NAME: 'nouveau_prefix',
DESCRIPTION: 'Le nouveau préfix du bot.',
},
},
EMBED: {
DESCRIPTION: 'Prefix changé en `{prefix}`.',
},
},
MAINTENANCE: {
DESCRIPTION: 'Met le mode maintenance du bot.',
EMBED: {
DESCRIPTION: 'Le mode maintenance a été définie à `{state}`.',
},
},
STATS: {
DESCRIPTION: 'Obtiens des statistiques sur le bot.',
HEADERS: {
COMMANDS: 'Commandes',
GUILDS: 'Serveurs',
ACTIVE_USERS: 'Utilisateurs actifs',
USERS: 'Utilisateurs',
},
},
HELP: {
DESCRIPTION: "Obtenez de l'aide globale sur le bot et ses commandes",
EMBED: {
TITLE: "Pannel d'aide",
CATEGORY_TITLE: 'Commandes de {category}',
},
SELECT_MENU: {
TITLE: 'Sélectionnez une catégorie',
CATEGORY_DESCRIPTION: 'Commandes de {category}',
},
},
PING: {
DESCRIPTION: 'Pong!',
MESSAGE: '{member} Pong! Le temps de réponse de la réponse était {time}ms.{heartbeat}',
},
},
} satisfies Translation

export default fr
13 changes: 13 additions & 0 deletions src/core/i18n/i18n-node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten.
/* eslint-disable */

import { i18n } from './i18n-util'
import { loadAllLocales } from './i18n-util.sync'
import type { LocaleTranslationFunctions } from 'typesafe-i18n'
import type { Locales, Translations, TranslationFunctions } from './i18n-types'

loadAllLocales()

export const L: LocaleTranslationFunctions<Locales, Translations, TranslationFunctions> = i18n()

export default L
Loading

0 comments on commit 4f92837

Please sign in to comment.