ref: replace "ctx.from.language_code" with a function to get the language code and fix ts implementation for "reply_to_message_id"

This commit is contained in:
GiovaniFZ 2025-05-01 16:23:36 -03:00
parent f8298dcf53
commit b085b62f43
No known key found for this signature in database
GPG key ID: 63DD92181B575322
17 changed files with 193 additions and 160 deletions

View file

@ -7,7 +7,10 @@ const languageFiles = {
'en-gb': '../locales/english.json'
};
function getStrings(languageCode: string) {
function getStrings(languageCode?: string) {
if (!languageCode) {
return require(languageFiles['en']);
}
const filePath: string = languageFiles[languageCode] || languageFiles['en'];
try {
return require(filePath);