Set portuguese language if user's telegram app is in portuguese

This commit is contained in:
GiovaniFZ 2024-07-25 22:40:06 -03:00
parent c86884774c
commit e140b24deb
6 changed files with 23 additions and 5 deletions

View file

@ -1,4 +1,4 @@
const Strings = require('../locales/english.json');
const { getStrings } = require('./checklang');
function getRandomInt(max) {
return Math.floor(Math.random() * max);
@ -6,6 +6,7 @@ function getRandomInt(max) {
module.exports = (bot) => {
bot.command('random', (ctx) => {
const Strings = getStrings(ctx.from.language_code);
const randomValue = getRandomInt(11);
const randomVStr = Strings.randomNum.replace('{number}', randomValue);