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

Co-authored-by: Lucas Gabriel <lucmsilva651@gmail.com>
This commit is contained in:
Giovani Finazzi 2025-05-02 21:08:13 -03:00 committed by GitHub
parent 6dce40d333
commit 87c987c16d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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);