Migrate to TypeScript, minor changes and fixes (#46)
* docs: linting, require bun for ts * rf: js -> ts * chore: bump * docs: add ts badge * chore: bump types * fix: add types for context to animal commands * [m] hf: add bot type * fix/types: add bot, ctx types, fix emoji on /dice cmd, add todo * fix/types: bot admin checking fixes, other misc fixes, add types --------- Co-authored-by: Lucas Gabriel <lucmsilva651@gmail.com>
This commit is contained in:
parent
6fd5652afa
commit
07045d8e09
32 changed files with 550 additions and 325 deletions
|
@ -1,22 +0,0 @@
|
|||
const languageFiles = {
|
||||
'pt': '../locales/portuguese.json',
|
||||
'pt-br': '../locales/portuguese.json',
|
||||
'pt-pt': '../locales/portuguese.json',
|
||||
'en': '../locales/english.json',
|
||||
'en-us': '../locales/english.json',
|
||||
'en-gb': '../locales/english.json'
|
||||
};
|
||||
|
||||
function getStrings(languageCode) {
|
||||
const filePath = languageFiles[languageCode] || languageFiles['en'];
|
||||
try {
|
||||
return require(filePath);
|
||||
} catch (error) {
|
||||
console.error(`Error loading language file for code ${languageCode}:`, error);
|
||||
return require(languageFiles['en']);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getStrings
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue