mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 04:39:57 +00:00
Put all strings of Last.fm on another JSON object
This commit is contained in:
parent
629401dee8
commit
b5e220b284
@ -66,7 +66,7 @@ module.exports = (bot) => {
|
|||||||
const lastUser = ctx.message.text.split(' ')[1];
|
const lastUser = ctx.message.text.split(' ')[1];
|
||||||
|
|
||||||
if (!lastUser) {
|
if (!lastUser) {
|
||||||
return ctx.reply(Strings.lastFmNoUser, {
|
return ctx.reply(Strings.lastFm.noUser, {
|
||||||
parse_mode: "Markdown",
|
parse_mode: "Markdown",
|
||||||
disable_web_page_preview: true,
|
disable_web_page_preview: true,
|
||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
@ -76,7 +76,7 @@ module.exports = (bot) => {
|
|||||||
users[userId] = lastUser;
|
users[userId] = lastUser;
|
||||||
saveUsers();
|
saveUsers();
|
||||||
|
|
||||||
const message = Strings.lastFmUserSet.replace('{lastUser}', lastUser);
|
const message = Strings.lastFm.userHasBeenSet.replace('{lastUser}', lastUser);
|
||||||
|
|
||||||
ctx.reply(message, {
|
ctx.reply(message, {
|
||||||
parse_mode: "Markdown",
|
parse_mode: "Markdown",
|
||||||
@ -93,7 +93,7 @@ module.exports = (bot) => {
|
|||||||
const botInfo = await ctx.telegram.getMe();
|
const botInfo = await ctx.telegram.getMe();
|
||||||
|
|
||||||
if (!lastfmUser) {
|
if (!lastfmUser) {
|
||||||
return ctx.reply(Strings.lastFmNoSet, {
|
return ctx.reply(Strings.lastFm.noUserSet, {
|
||||||
parse_mode: "Markdown",
|
parse_mode: "Markdown",
|
||||||
disable_web_page_preview: true,
|
disable_web_page_preview: true,
|
||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
@ -117,7 +117,7 @@ module.exports = (bot) => {
|
|||||||
const track = response.data.recenttracks.track[0];
|
const track = response.data.recenttracks.track[0];
|
||||||
|
|
||||||
if (!track) {
|
if (!track) {
|
||||||
const noRecent = Strings.lastFmNoRecent.replace('{lastfmUser}', lastfmUser);
|
const noRecent = Strings.lastFm.noRecentTracks.replace('{lastfmUser}', lastfmUser);
|
||||||
return ctx.reply(noRecent, {
|
return ctx.reply(noRecent, {
|
||||||
parse_mode: "Markdown",
|
parse_mode: "Markdown",
|
||||||
disable_web_page_preview: true,
|
disable_web_page_preview: true,
|
||||||
@ -170,7 +170,7 @@ module.exports = (bot) => {
|
|||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
const message = Strings.lastFmErr
|
const message = Strings.lastFm.apiErr
|
||||||
.replace("{lastfmUser}", `[${lastfmUser}](${userUrl})`)
|
.replace("{lastfmUser}", `[${lastfmUser}](${userUrl})`)
|
||||||
.replace("{err}", err);
|
.replace("{err}", err);
|
||||||
ctx.reply(message, {
|
ctx.reply(message, {
|
||||||
@ -180,7 +180,7 @@ module.exports = (bot) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
let message = Strings.lastFmStatusFor
|
let message = Strings.lastFm.listeningTo
|
||||||
.replace("{lastfmUser}", `[${lastfmUser}](${userUrl})`)
|
.replace("{lastfmUser}", `[${lastfmUser}](${userUrl})`)
|
||||||
.replace("{nowPlaying}", nowPlaying)
|
.replace("{nowPlaying}", nowPlaying)
|
||||||
.replace("{trackName}", `[${trackName}](${trackUrl})`)
|
.replace("{trackName}", `[${trackName}](${trackUrl})`)
|
||||||
@ -188,7 +188,7 @@ module.exports = (bot) => {
|
|||||||
|
|
||||||
if (`${num_plays}` !== "0" && `${num_plays}` !== "1" && `${num_plays}` !== "2" && `${num_plays}` !== "3") {
|
if (`${num_plays}` !== "0" && `${num_plays}` !== "1" && `${num_plays}` !== "2" && `${num_plays}` !== "3") {
|
||||||
message = message
|
message = message
|
||||||
.replace("{playCount}", Strings.lastFmPlayCount)
|
.replace("{playCount}", Strings.lastFm.playCount)
|
||||||
.replace("{plays}", `${num_plays}`);
|
.replace("{plays}", `${num_plays}`);
|
||||||
} else {
|
} else {
|
||||||
message = message
|
message = message
|
||||||
@ -211,7 +211,7 @@ module.exports = (bot) => {
|
|||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const userUrl = `https://www.last.fm/user/${encodeURIComponent(lastfmUser)}`;
|
const userUrl = `https://www.last.fm/user/${encodeURIComponent(lastfmUser)}`;
|
||||||
const message = Strings.lastFmErr
|
const message = Strings.lastFm.apiErr
|
||||||
.replace("{lastfmUser}", `[${lastfmUser}](${userUrl})`)
|
.replace("{lastfmUser}", `[${lastfmUser}](${userUrl})`)
|
||||||
.replace("{err}", err);
|
.replace("{err}", err);
|
||||||
ctx.reply(message, {
|
ctx.reply(message, {
|
||||||
|
@ -38,13 +38,17 @@
|
|||||||
"chatInfo": "*Chat info*\n\n*Name:* `{chatName}`\n*Chat ID:* `{chatId}`\n*Handle:* `{chatHandle}`\n*Type:* `{chatType}`\n*Members:* `{chatMembersCount}`\n*Is a forum:* `{isForum}`",
|
"chatInfo": "*Chat info*\n\n*Name:* `{chatName}`\n*Chat ID:* `{chatId}`\n*Handle:* `{chatHandle}`\n*Type:* `{chatType}`\n*Members:* `{chatMembersCount}`\n*Is a forum:* `{isForum}`",
|
||||||
"funEmojiResult": "*You rolled {emoji} and got* `{value}`*!*\nYou don't know what that means? Me neither!",
|
"funEmojiResult": "*You rolled {emoji} and got* `{value}`*!*\nYou don't know what that means? Me neither!",
|
||||||
"gifErr": "*Something went wrong while sending the GIF. Please try again later.*\n\n{err}",
|
"gifErr": "*Something went wrong while sending the GIF. Please try again later.*\n\n{err}",
|
||||||
"lastFmNoUser": "*Please provide a Last.fm username.*\nExample: `/setuser <username>`",
|
"lastFm": {
|
||||||
"lastFmNoSet": "*You haven't set your Last.fm username yet.*\nUse the command /setuser to set.\n\nExample: `/setuser <username>`",
|
"helpEntry": "Last.fm",
|
||||||
"lastFmNoRecent": "*No recent tracks found for Last.fm user* `{lastfmUser}`*.*",
|
"helpDesc": "*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.",
|
||||||
"lastFmUserSet": "*Your Last.fm username has been set to:* `{lastUser}`.",
|
"noUser": "*Please provide a Last.fm username.*\nExample: `/setuser <username>`",
|
||||||
"lastFmStatusFor": "{lastfmUser} *{nowPlaying} listening {playCount}*:\n\n{trackName} by {artistName}",
|
"noUserSet": "*You haven't set your Last.fm username yet.*\nUse the command /setuser to set.\n\nExample: `/setuser <username>`",
|
||||||
"lastFmPlayCount": "by the {plays}th time",
|
"noRecentTracks": "*No recent tracks found for Last.fm user* `{lastfmUser}`*.*",
|
||||||
"lastFmErr": "*Error retrieving data for Last.fm user* {lastfmUser}.\n\n`{err}`",
|
"userHasBeenSet": "*Your Last.fm username has been set to:* `{lastUser}`.",
|
||||||
|
"listeningTo": "{lastfmUser} *{nowPlaying} listening {playCount}*:\n\n{trackName} by {artistName}",
|
||||||
|
"playCount": "by the {plays}th time",
|
||||||
|
"apiErr": "*Error retrieving data for Last.fm user* {lastfmUser}.\n\n`{err}`"
|
||||||
|
},
|
||||||
"gitCurrentCommit": "*Current commit:* `{commitHash}`",
|
"gitCurrentCommit": "*Current commit:* `{commitHash}`",
|
||||||
"gitErrRetrievingCommit": "*Error retrieving commit:* {error}",
|
"gitErrRetrievingCommit": "*Error retrieving commit:* {error}",
|
||||||
"weatherStatus": {
|
"weatherStatus": {
|
||||||
@ -63,8 +67,6 @@
|
|||||||
"interactiveEmojisDesc": "*Interactive emojis*\n\n- /dice: Roll a dice\n- /idice: Infinitely roll a colored dice\n- /slot: Try to combine the figures!\n- /ball: Try to kick the ball into the goal!\n- /bowling: Try to hit the pins!\n- /dart: Try to hit the target!",
|
"interactiveEmojisDesc": "*Interactive emojis*\n\n- /dice: Roll a dice\n- /idice: Infinitely roll a colored dice\n- /slot: Try to combine the figures!\n- /ball: Try to kick the ball into the goal!\n- /bowling: Try to hit the pins!\n- /dart: Try to hit the target!",
|
||||||
"ytDlp": "Video download",
|
"ytDlp": "Video download",
|
||||||
"ytDlpDesc": "*Video download*\n\n- /yt | /ytdl | /sdl | /dl | /video `<video link>`: Download a video from some platforms (e.g. YouTube, Instagram, Facebook, etc.).\n\n See [this link](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) for more information and which services are supported.\n\n*Note: Telegram is currently limiting bot uploads to 50MB, which means that if the video you want to download is larger than 50MB, the quality will be reduced to try to upload it anyway. We're trying our best to work around or fix this problem.*",
|
"ytDlpDesc": "*Video download*\n\n- /yt | /ytdl | /sdl | /dl | /video `<video link>`: Download a video from some platforms (e.g. YouTube, Instagram, Facebook, etc.).\n\n See [this link](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) for more information and which services are supported.\n\n*Note: Telegram is currently limiting bot uploads to 50MB, which means that if the video you want to download is larger than 50MB, the quality will be reduced to try to upload it anyway. We're trying our best to work around or fix this problem.*",
|
||||||
"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",
|
"animalCommands": "Animals",
|
||||||
"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`",
|
"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",
|
"myLittlePony": "My Little Pony",
|
||||||
|
@ -38,13 +38,17 @@
|
|||||||
"chatInfo": "*Informações do chat*\n\n*Nome:* `{chatName}`\n*ID do chat:* `{chatId}`\n*Identificador:* `{chatHandle}`\n*Tipo:* `{chatType}`\n*Membros:* `{chatMembersCount}`\n*É um fórum:* `{isForum}`",
|
"chatInfo": "*Informações do chat*\n\n*Nome:* `{chatName}`\n*ID do chat:* `{chatId}`\n*Identificador:* `{chatHandle}`\n*Tipo:* `{chatType}`\n*Membros:* `{chatMembersCount}`\n*É um fórum:* `{isForum}`",
|
||||||
"funEmojiResult": "*Você lançou {emoji} e obteve *`{value}`*!*\nVocê não sabe o que isso significa? Nem eu!",
|
"funEmojiResult": "*Você lançou {emoji} e obteve *`{value}`*!*\nVocê não sabe o que isso significa? Nem eu!",
|
||||||
"gifErr": "*Algo deu errado ao enviar o GIF. Tente novamente mais tarde.*\n\n{err}",
|
"gifErr": "*Algo deu errado ao enviar o GIF. Tente novamente mais tarde.*\n\n{err}",
|
||||||
"lastFmNoUser": "*Por favor, forneça um nome de usuário do Last.fm.*\nExemplo: `/setuser <username>`",
|
"lastFm": {
|
||||||
"lastFmNoSet": "*Você ainda não definiu seu nome de usuário do Last.fm.*\nUse o comando /setuser para definir.\n\nExemplo: `/setuser <username>`",
|
"helpEntry": "Last.fm",
|
||||||
"lastFmNoRecent": "*Nenhuma faixa recente encontrada para o usuário do Last.fm* `{lastfmUser}`*.*",
|
"helpDesc": "*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.",
|
||||||
"lastFmUserSet": "*Seu nome de usuário do Last.fm foi definido como:* `{lastUser}`.",
|
"noUser": "*Por favor, forneça um nome de usuário do Last.fm.*\nExemplo: `/setuser <username>`",
|
||||||
"lastFmStatusFor": "{lastfmUser} *{nowPlaying} ouvindo{playCount}*:\n\n{trackName} por {artistName}",
|
"noUserSet": "*Você ainda não definiu seu nome de usuário do Last.fm.*\nUse o comando /setuser para definir.\n\nExemplo: `/setuser <username>`",
|
||||||
"lastFmPlayCount": " pela {plays}ª vez",
|
"noRecentTracks": "*Nenhuma faixa recente encontrada para o usuário do Last.fm* `{lastfmUser}`*.*",
|
||||||
"lastFmErr": "*Erro ao recuperar dados para o usuário do Last.fm* {lastfmUser}.\n\n`{err}`",
|
"userHasBeenSet": "*Seu nome de usuário do Last.fm foi definido como:* `{lastUser}`.",
|
||||||
|
"listeningTo": "{lastfmUser} *{nowPlaying} ouvindo{playCount}*:\n\n{trackName} por {artistName}",
|
||||||
|
"playCount": " pela {plays}ª vez",
|
||||||
|
"apiErr": "*Erro ao recuperar dados para o usuário do Last.fm* {lastfmUser}.\n\n`{err}`"
|
||||||
|
},
|
||||||
"gitCurrentCommit": "*Commit atual:* `{commitHash}`",
|
"gitCurrentCommit": "*Commit atual:* `{commitHash}`",
|
||||||
"gitErrRetrievingCommit": "*Erro ao obter o commit:*\n\n`{error}`",
|
"gitErrRetrievingCommit": "*Erro ao obter o commit:*\n\n`{error}`",
|
||||||
"weatherStatus": {
|
"weatherStatus": {
|
||||||
@ -63,8 +67,6 @@
|
|||||||
"interactiveEmojisDesc": "*Emojis interativos*\n\n- /dice: Jogue um dado\n- /idice: Role infinitamente um dado colorido\n- /slot: Tente combinar as figuras!\n- /ball: Tente chutar a bola no gol!\n- /bowling: Tente derrubar os pinos!\n- /dart: Tente acertar o alvo!",
|
"interactiveEmojisDesc": "*Emojis interativos*\n\n- /dice: Jogue um dado\n- /idice: Role infinitamente um dado colorido\n- /slot: Tente combinar as figuras!\n- /ball: Tente chutar a bola no gol!\n- /bowling: Tente derrubar os pinos!\n- /dart: Tente acertar o alvo!",
|
||||||
"ytDlp": "Download de vídeos",
|
"ytDlp": "Download de vídeos",
|
||||||
"ytDlpDesc": "*Download de vídeos*\n\n- /yt | /ytdl | /sdl | /dl | /video `<link do vídeo>`: Baixa um vídeo de algumas plataformas (ex: YouTube, Instagram, Facebook, etc.).\n\nConsulte [este link](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) para obter mais informações e saber quais serviços são compatíveis.\n\n*Nota: O Telegram está atualmente limitando os uploads de bots a 50MB, o que significa que se o vídeo que você deseja baixar for maior que 50MB, a qualidade será reduzida para tentar carregá-lo de qualquer maneira. Estamos fazendo o possível para contornar ou corrigir esse problema.*",
|
"ytDlpDesc": "*Download de vídeos*\n\n- /yt | /ytdl | /sdl | /dl | /video `<link do vídeo>`: Baixa um vídeo de algumas plataformas (ex: YouTube, Instagram, Facebook, etc.).\n\nConsulte [este link](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) para obter mais informações e saber quais serviços são compatíveis.\n\n*Nota: O Telegram está atualmente limitando os uploads de bots a 50MB, o que significa que se o vídeo que você deseja baixar for maior que 50MB, a qualidade será reduzida para tentar carregá-lo de qualquer maneira. Estamos fazendo o possível para contornar ou corrigir esse problema.*",
|
||||||
"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",
|
"animalCommands": "Animais",
|
||||||
"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`",
|
"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",
|
"myLittlePony": "My Little Pony",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user