Update README.md + Translations #6
6 changed files with 23 additions and 5 deletions
11
commands/checklang.js
Normal file
11
commands/checklang.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
function getStrings(languageCode) {
|
||||||
|
if (languageCode === 'pt-br') {
|
||||||
|
return require('../locales/portuguese.json');
|
||||||
|
} else {
|
||||||
|
return require('../locales/english.json');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
getStrings
|
||||||
|
};
|
|
@ -1,7 +1,8 @@
|
||||||
const Strings = require('../locales/english.json');
|
|
||||||
const resources = require('../props/resources.json');
|
const resources = require('../props/resources.json');
|
||||||
|
const { getStrings } = require('./checklang');
|
||||||
|
|
||||||
function furryFunction(ctx) {
|
function furryFunction(ctx) {
|
||||||
|
const Strings = getStrings(ctx.from.language_code);
|
||||||
if (Math.random() < 0.5 ? "yes" : "no" === "yes") {
|
if (Math.random() < 0.5 ? "yes" : "no" === "yes") {
|
||||||
ctx.replyWithAnimation(
|
ctx.replyWithAnimation(
|
||||||
resources.furryGif, {
|
resources.furryGif, {
|
||||||
|
@ -21,6 +22,7 @@ function furryFunction(ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function gayFunction(ctx) {
|
function gayFunction(ctx) {
|
||||||
|
const Strings = getStrings(ctx.from.language_code);
|
||||||
if (Math.random() < 0.5 ? "yes" : "no" === "yes") {
|
if (Math.random() < 0.5 ? "yes" : "no" === "yes") {
|
||||||
ctx.replyWithAnimation(
|
ctx.replyWithAnimation(
|
||||||
resources.gayFlag, {
|
resources.gayFlag, {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const Strings = require('../locales/english.json');
|
|
||||||
const Config = require('../props/config.json');
|
const Config = require('../props/config.json');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
|
const { getStrings } = require('./checklang');
|
||||||
|
|
||||||
function formatUptime(uptime) {
|
function formatUptime(uptime) {
|
||||||
const hours = Math.floor(uptime / 3600);
|
const hours = Math.floor(uptime / 3600);
|
||||||
|
@ -34,6 +34,7 @@ function getSystemInfo() {
|
||||||
|
|
||||||
// Função para obter informações do usuário
|
// Função para obter informações do usuário
|
||||||
async function getUserInfo(ctx) {
|
async function getUserInfo(ctx) {
|
||||||
|
const Strings = getStrings(ctx.from.language_code);
|
||||||
let userInfoTemplate = Strings.userInfo;
|
let userInfoTemplate = Strings.userInfo;
|
||||||
|
|
||||||
const userName = ctx.from.first_name || Strings.unKnown;
|
const userName = ctx.from.first_name || Strings.unKnown;
|
||||||
|
@ -56,6 +57,7 @@ async function getUserInfo(ctx) {
|
||||||
|
|
||||||
// Função para obter informações do chat
|
// Função para obter informações do chat
|
||||||
async function getChatInfo(ctx) {
|
async function getChatInfo(ctx) {
|
||||||
|
const Strings = getStrings(ctx.from.language_code);
|
||||||
if (ctx.chat.type === 'group' || ctx.chat.type === 'supergroup') {
|
if (ctx.chat.type === 'group' || ctx.chat.type === 'supergroup') {
|
||||||
let chatInfoTemplate = Strings.chatInfo;
|
let chatInfoTemplate = Strings.chatInfo;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
const Strings = require('../locales/english.json');
|
const { getStrings } = require('./checklang');
|
||||||
const resources = require('../props/resources.json');
|
const resources = require('../props/resources.json');
|
||||||
|
|
||||||
module.exports = (bot) => {
|
module.exports = (bot) => {
|
||||||
bot.help((ctx) => {
|
bot.help((ctx) => {
|
||||||
|
const Strings = getStrings(ctx.from.language_code);
|
||||||
ctx.replyWithPhoto(
|
ctx.replyWithPhoto(
|
||||||
resources.lynxFullPhoto, {
|
resources.lynxFullPhoto, {
|
||||||
caption: Strings.lynxHelp,
|
caption: Strings.lynxHelp,
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
const Strings = require('../locales/english.json');
|
const { getStrings } = require('./checklang');
|
||||||
|
|
||||||
module.exports = (bot) => {
|
module.exports = (bot) => {
|
||||||
bot.command('privacy', (ctx) => {
|
bot.command('privacy', (ctx) => {
|
||||||
|
const Strings = getStrings(ctx.from.language_code);
|
||||||
ctx.reply(
|
ctx.reply(
|
||||||
Strings.lynxPrivacy, {
|
Strings.lynxPrivacy, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const Strings = require('../locales/english.json');
|
const { getStrings } = require('./checklang');
|
||||||
|
|
||||||
function getRandomInt(max) {
|
function getRandomInt(max) {
|
||||||
return Math.floor(Math.random() * max);
|
return Math.floor(Math.random() * max);
|
||||||
|
@ -6,6 +6,7 @@ function getRandomInt(max) {
|
||||||
|
|
||||||
module.exports = (bot) => {
|
module.exports = (bot) => {
|
||||||
bot.command('random', (ctx) => {
|
bot.command('random', (ctx) => {
|
||||||
|
const Strings = getStrings(ctx.from.language_code);
|
||||||
const randomValue = getRandomInt(11);
|
const randomValue = getRandomInt(11);
|
||||||
const randomVStr = Strings.randomNum.replace('{number}', randomValue);
|
const randomVStr = Strings.randomNum.replace('{number}', randomValue);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue