Improved string variable names

This commit is contained in:
Lucas Gabriel 2025-01-10 10:09:47 -03:00
parent d1494fbd80
commit 8227d88e72
No known key found for this signature in database
GPG Key ID: D9B075FC6DC93985
6 changed files with 26 additions and 26 deletions

View File

@ -91,17 +91,17 @@ module.exports = (bot) => {
handleAdminCommand(ctx, async () => {
try {
const commitHash = await getGitCommitHash();
await ctx.reply(Strings.currentCommit.replace('{commitHash}', commitHash), {
await ctx.reply(Strings.gitCurrentCommit.replace('{commitHash}', commitHash), {
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
});
} catch (error) {
ctx.reply(Strings.errorRetrievingCommit.replace('{error}', error), {
ctx.reply(Strings.gitErrRetrievingCommit.replace('{error}', error), {
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
});
}
}, '', Strings.errorRetrievingCommit);
}, '', Strings.gitErrRetrievingCommit);
});
bot.command('updatebot', spamwatchMiddleware, async (ctx) => {
@ -159,12 +159,12 @@ module.exports = (bot) => {
caption: botFile
});
} catch (error) {
ctx.reply(Strings.varErr.replace('{error}', error.message), {
ctx.reply(Strings.unexpectedErr.replace('{error}', error.message), {
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
});
}
}, '', Strings.varErr);
}, '', Strings.unexpectedErr);
});
bot.command('run', spamwatchMiddleware, async (ctx) => {

View File

@ -97,7 +97,7 @@ module.exports = (bot) => {
sendRandomReply(ctx, resources.gayFlag, 'isGay', 'isNtGay');
});
bot.command('soggy', spamwatchMiddleware, async (ctx) => {
bot.command('soggy', 'soggycat', spamwatchMiddleware, async (ctx) => {
const userInput = ctx.message.text.split(' ')[1];
switch (true) {

View File

@ -46,7 +46,7 @@ module.exports = (bot) => {
disable_web_page_preview: true,
reply_markup: JSON.stringify({
inline_keyboard: [
[{ text: Strings.goBack, callback_data: 'helpBack' }],
[{ text: Strings.varBack, callback_data: 'helpBack' }],
]
})
};
@ -93,7 +93,7 @@ module.exports = (bot) => {
await sendHelpMessage(ctx, true);
break;
default:
await ctx.answerCbQuery(Strings.invalidOption);
await ctx.answerCbQuery(Strings.errInvalidOption);
break;
}
});

View File

@ -38,7 +38,7 @@ module.exports = (bot) => {
const args = ctx.message.text;
if (args.length < 9) {
return ctx.reply(Strings.provideLocation, {
return ctx.reply(Strings.weatherProvideLocation, {
parse_mode: "Markdown",
reply_to_message_id: ctx.message.message_id
});
@ -59,7 +59,7 @@ module.exports = (bot) => {
const locationData = locationResponse.data.location;
if (!locationData || !locationData.address) {
return ctx.reply(Strings.invalidLocation, {
return ctx.reply(Strings.weatherInvalidLocation, {
parse_mode: "Markdown",
reply_to_message_id: ctx.message.message_id
});

View File

@ -11,8 +11,9 @@
"varIs": "is",
"varWas": "was",
"varNone": "None",
"varErr": "Some unexpected error occurred during a bot action. Please report it to the developers.",
"invalidOption": "Whoops! Invalid option!",
"varBack": "Back",
"unexpectedErr": "Some unexpected error occurred during a bot action. Please report it to the developers.",
"errInvalidOption": "Whoops! Invalid option!",
"kickingMyself": "*Since you don't need me, I'll leave.*",
"kickingMyselfErr": "Error leaving the chat.",
"noPermission": "You don't have permission to run this command.",
@ -44,10 +45,10 @@
"lastFmStatusFor": "{lastfmUser} *{nowPlaying} listening {playCount}*:\n\n{trackName} by {artistName}",
"lastFmPlayCount": "by the {plays}th time",
"lastFmErr": "*Error retrieving data for Last.fm user* {lastfmUser}.\n\n`{err}`",
"currentCommit": "*Current commit:* `{commitHash}`",
"errorRetrievingCommit": "*Error retrieving commit:* {error}",
"provideLocation": "*Please provide a location.*",
"invalidLocation": "*Invalid location. Try again.*",
"gitCurrentCommit": "*Current commit:* `{commitHash}`",
"gitErrRetrievingCommit": "*Error retrieving commit:* {error}",
"weatherProvideLocation": "*Please provide a location.*",
"weatherInvalidLocation": "*Invalid location. Try again.*",
"weatherStatus": "*Weather in {addressFirst}:*\n\n*Status:* `{getStatusEmoji(iconCode)} {wxPhraseLong}`\n*Temperature:* `{temperature} °{temperatureUnit}`\n*Feels like:* `{temperatureFeelsLike} °{temperatureUnit2}`\n*Humidity:* `{relativeHumidity}%`\n*Wind speed:* `{windSpeed} {speedUnit}`",
"weatherErr": "*An error occurred while retrieving the weather. Please try again later.*\n\n`{error}`",
"mainCommands": "Main commands",
@ -63,10 +64,9 @@
"lastFm": "Last.fm",
"lastFmDesc": "*Last.fm*\n\n- /lt | /lmu | /last | /lfm: Shows the last song from your Last.fm profile + the number of plays.\n- /setuser `<user>`: Sets the user for the command above.",
"animalCommands": "Animals",
"animalCommandsDesc": "*Animals*\n\n- /soggy `<1 | 2 | 3 | 4 | orig | thumb | sticker | alt>`: Sends the [Soggy cat meme](https://knowyourmeme.com/memes/soggy-cat)\n - /cat `<tags>`: Sends a random picture of a cat. You can specify some tags, separating each by a comma. Example: `/cat orange, cute`\n- /dog: Sends a random picture of a dog.\n- /httpcat `<http code>`: Send cat memes from http.cat with your specified HTTP code. Example: `/httpcat 404`",
"animalCommandsDesc": "*Animals*\n\n- /soggy | /soggycat `<1 | 2 | 3 | 4 | orig | thumb | sticker | alt>`: Sends the [Soggy cat meme](https://knowyourmeme.com/memes/soggy-cat)\n - /cat `<tags>`: Sends a random picture of a cat. You can specify some tags, separating each by a comma. Example: `/cat orange, cute`\n- /dog: Sends a random picture of a dog.\n- /httpcat `<http code>`: Send cat memes from http.cat with your specified HTTP code. Example: `/httpcat 404`",
"myLittlePony": "My Little Pony",
"myLittlePonyDesc": "*My Little Pony*\n\n- /mlp: Displays this help message.\n- /mlpchar `<character name>`: Shows specific information about a My Little Pony character. Example: `/mlpchar twilight`\n- /mlpep: Shows specific information about a My Little Pony episode. Example: `/mlpep 136`",
"goBack": "Back",
"maInvalidModule": "Please provide a valid module ID from The Mod Archive.\nExample: `/modarchive 81574`",
"maDownloadError": "Error downloading the file. Check the module ID and try again.",
"ytDownloading": "*Downloading video...*",

View File

@ -11,8 +11,9 @@
"varIs": "está",
"varWas": "estava",
"varNone": "Nenhum",
"varErr": "Algum erro inesperado ocorreu durante uma ação do bot. Por favor, reporte aos desenvolvedores.\n\n{error}",
"invalidOption": "Ops! Opção inválida!",
"varBack": "Voltar",
"unexpectedErr": "Algum erro inesperado ocorreu durante uma ação do bot. Por favor, reporte aos desenvolvedores.\n\n{error}",
"errInvalidOption": "Ops! Opção inválida!",
"kickingMyself": "*Já que você não precisa de mim, vou sair daqui.*",
"kickingMyselfErr": "Erro ao sair do chat.",
"noPermission": "Você não tem permissão para executar este comando.",
@ -44,10 +45,10 @@
"lastFmStatusFor": "{lastfmUser} *{nowPlaying} ouvindo{playCount}*:\n\n{trackName} por {artistName}",
"lastFmPlayCount": " pela {plays}ª vez",
"lastFmErr": "*Erro ao recuperar dados para o usuário do Last.fm* {lastfmUser}.\n\n`{err}`",
"currentCommit": "*Commit atual:* `{commitHash}`",
"errorRetrievingCommit": "*Erro ao obter o commit:*\n\n`{error}`",
"provideLocation": "*Por favor, forneça uma localização.*",
"invalidLocation": "*Localização inválida. Tente novamente.*",
"gitCurrentCommit": "*Commit atual:* `{commitHash}`",
"gitErrRetrievingCommit": "*Erro ao obter o commit:*\n\n`{error}`",
"weatherProvideLocation": "*Por favor, forneça uma localização.*",
"weatherInvalidLocation": "*Localização inválida. Tente novamente.*",
"weatherStatus": "*Clima em {addressFirst}:*\n\n*Estado:* `{getStatusEmoji(iconCode)} {wxPhraseLong}`\n*Temperatura:* `{temperature} °{temperatureUnit}`\n*Sensação térmica:* `{temperatureFeelsLike} °{temperatureUnit2}`\n*Umidade:* `{relativeHumidity}%`\n*Velocidade do vento:* `{windSpeed} {speedUnit}`",
"weatherErr": "*Ocorreu um erro ao obter o clima. Tente novamente mais tarde.*\n\n`{error}`",
"mainCommands": "Comandos principais",
@ -63,10 +64,9 @@
"lastFm": "Last.fm",
"lastFmDesc": "*Last.fm*\n\n- /lt | /lmu | /last | /lfm: Mostra a última música do seu perfil no Last.fm + o número de reproduções.\n- /setuser `<usuário>`: Define o usuário para o comando acima.",
"animalCommands": "Animais",
"animalCommandsDesc": "*Animais*\n\n- /soggy `<1 | 2 | 3 | 4 | orig | thumb | sticker | alt>`: Envia o [meme do gato encharcado](https://knowyourmeme.com/memes/soggy-cat)\n- /cat `<tags>` - Envia uma foto aleatória de um gato. Você pode especificar algumas tags em inglês, separando cada uma por uma vírgula. Exemplo: `/cat orange, cute`\n- /dog - Envia uma imagem aleatória de um cachorro.\n- /httpcat `<código http>`: Envia memes de gato do http.cat com o código HTTP especificado. Exemplo: `/httpcat 404`",
"animalCommandsDesc": "*Animais*\n\n- /soggy | /soggycat `<1 | 2 | 3 | 4 | orig | thumb | sticker | alt>`: Envia o [meme do gato encharcado](https://knowyourmeme.com/memes/soggy-cat)\n- /cat `<tags>` - Envia uma foto aleatória de um gato. Você pode especificar algumas tags em inglês, separando cada uma por uma vírgula. Exemplo: `/cat orange, cute`\n- /dog - Envia uma imagem aleatória de um cachorro.\n- /httpcat `<código http>`: Envia memes de gato do http.cat com o código HTTP especificado. Exemplo: `/httpcat 404`",
"myLittlePony": "My Little Pony",
"myLittlePonyDesc": "*My Little Pony*\n\n- /mlp: Exibe esta mensagem de ajuda.\n- /mlpchar `<nome do personagem>`: Mostra informações específicas sobre um personagem de My Little Pony em inglês. Exemplo: `/mlpchar twilight`\n- /mlpep: Mostra informações específicas sobre um episódio de My Little Pony em inglês. Exemplo: `/mlpep 136`",
"goBack": "Voltar",
"maInvalidModule": "Por favor, forneça um ID de módulo válido do The Mod Archive.\nExemplo: `/modarchive 81574`",
"maDownloadError": "Erro ao baixar o arquivo. Verifique o ID do módulo e tente novamente.",
"ytDownloading": "*Baixando vídeo...*",