Compare commits
No commits in common. "1349ad52bb84cfdb598626fafe21a1c6e55972ee" and "fc427fd008df3ed4c85dca2aa0fbd3c4efc06f19" have entirely different histories.
1349ad52bb
...
fc427fd008
4 changed files with 39 additions and 61 deletions
|
@ -12,7 +12,5 @@
|
|||
"c_help_opt1_desc": "Commande voulu en détail.",
|
||||
"c_help1": "Liste des catégories et des commandes associées",
|
||||
"c_help2": "`/help <commande>` pour obtenir plus d'informations sur une commande.",
|
||||
"c_help3": "Impossible de trouver :",
|
||||
|
||||
"u_time_at": "à"
|
||||
"c_help3": "Impossible de trouver :"
|
||||
}
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
import { Collection } from 'discord.js';
|
||||
import { SlashCommandBuilder } from '@discordjs/builders';
|
||||
|
||||
export {};
|
||||
|
||||
declare module 'discord.js' {
|
||||
// eslint-disable-next-line no-shadow
|
||||
export interface Client {
|
||||
/** Store the configuration */
|
||||
config: {
|
||||
/** Bot version */
|
||||
version: string,
|
||||
/** Bot token from env variable */
|
||||
token_discord: string | undefined,
|
||||
/** Default lang used */
|
||||
default_lang: string
|
||||
},
|
||||
/** Store all the slash commands */
|
||||
commands: {
|
||||
categories: Collection<
|
||||
/** Category name */
|
||||
string,
|
||||
/** Name of the commands in the category */
|
||||
string[]
|
||||
>,
|
||||
list: Collection<
|
||||
/** Command name */
|
||||
string,
|
||||
/** Command itself */
|
||||
{
|
||||
/** Data about the command */
|
||||
data: SlashCommandBuilder,
|
||||
/** How the command interact */
|
||||
interaction: (interaction: CommandInteraction, client: Client) => unknown
|
||||
}
|
||||
>,
|
||||
}
|
||||
/** Store all the localizations */
|
||||
locales: Map<string, Map<string, string>>
|
||||
}
|
||||
}
|
|
@ -1,7 +1,44 @@
|
|||
import { Client, Collection, Intents } from 'discord.js';
|
||||
import { readFileSync } from 'fs';
|
||||
import { SlashCommandBuilder } from '@discordjs/builders';
|
||||
import { loadLocales } from './locales';
|
||||
import '../modules/client';
|
||||
|
||||
declare module 'discord.js' {
|
||||
// eslint-disable-next-line no-shadow
|
||||
export interface Client {
|
||||
/** Store the configuration */
|
||||
config: {
|
||||
/** Bot version */
|
||||
version: string,
|
||||
/** Bot token from env variable */
|
||||
token_discord: string | undefined,
|
||||
/** Default lang used */
|
||||
default_lang: string
|
||||
},
|
||||
/** Store all the slash commands */
|
||||
commands: {
|
||||
categories: Collection<
|
||||
/** Category name */
|
||||
string,
|
||||
/** Name of the commands in the category */
|
||||
string[]
|
||||
>,
|
||||
list: Collection<
|
||||
/** Command name */
|
||||
string,
|
||||
/** Command itself */
|
||||
{
|
||||
/** Data about the command */
|
||||
data: SlashCommandBuilder,
|
||||
/** How the command interact */
|
||||
interaction: (interaction: CommandInteraction, client: Client) => unknown
|
||||
}
|
||||
>,
|
||||
}
|
||||
/** Store all the localizations */
|
||||
locales: Map<string, Map<string, string>>
|
||||
}
|
||||
}
|
||||
|
||||
/** Creation of the client and definition of its properties. */
|
||||
export default async () => {
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
/**
|
||||
* Parsed string adapted with TZ (locales) and format for the specified lang.
|
||||
* @param lang Lang
|
||||
* @param locale Locales
|
||||
* @param date Date
|
||||
* @returns String
|
||||
*/
|
||||
export const showDate = (
|
||||
lang: string,
|
||||
locale: Map<string, unknown>,
|
||||
date: Date
|
||||
) => {
|
||||
return date.toLocaleString(lang).replace(' ', ` ${
|
||||
locale.get('u_time_at')
|
||||
} `);
|
||||
};
|
Loading…
Reference in a new issue