mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 04:39:57 +00:00
Put all MLP strings on another JSON object
This commit is contained in:
parent
87280cab21
commit
e6fec9abe8
@ -115,7 +115,7 @@ function formatPhone(phone) {
|
||||
.filter(([_, key]) => formattedPhone[key])
|
||||
.map(([label, key]) => `<b>${label}:</b> <code>${formattedPhone[key]}</code>`)
|
||||
.join("\n\n");
|
||||
|
||||
|
||||
const deviceUrl = `<b>GSMArena page:</b> ${formattedPhone.url}`;
|
||||
const deviceImage = phone.picture ? `<b>Device Image</b>: ${phone.picture}` : '';
|
||||
|
||||
@ -208,9 +208,10 @@ module.exports = (bot) => {
|
||||
return ctx.reply("No phones found.", { reply_to_message_id: ctx.message.message_id });
|
||||
}
|
||||
|
||||
const testUser = `<a href="tg://user?id=${userId}">${userName}</a>, Select a device:`;
|
||||
const testUser = `<a href="tg://user?id=${userId}">${userName}</a>, please select your device:`;
|
||||
const options = {
|
||||
parse_mode: 'HTML',
|
||||
reply_to_message_id: ctx.message.message_id,
|
||||
disable_web_page_preview: true,
|
||||
reply_markup: {
|
||||
inline_keyboard: results.map(result => [{ text: result.name, callback_data: `details:${result.url}:${ctx.from.id}` }])
|
||||
@ -237,7 +238,7 @@ module.exports = (bot) => {
|
||||
|
||||
if (phoneDetails.name) {
|
||||
const message = formatPhone(phoneDetails);
|
||||
ctx.editMessageText(`<b><a href="tg://user?id=${userId}">${userName}</a>, there are the details of your device:</b>` + message, { parse_mode: 'HTML', disable_web_page_preview: false });
|
||||
ctx.editMessageText(`<b><a href="tg://user?id=${userId}">${userName}</a>, these are the details of your device:</b>` + message, { parse_mode: 'HTML', disable_web_page_preview: false });
|
||||
} else {
|
||||
ctx.reply("Error fetching phone details.", { reply_to_message_id: ctx.message.message_id });
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ module.exports = (bot) => {
|
||||
const userInput = ctx.message.text.split(' ').slice(1).join(' ');
|
||||
|
||||
if (!userInput) {
|
||||
ctx.reply(Strings.ponyApiNoCharName, {
|
||||
ctx.reply(Strings.ponyApi.noCharName, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
@ -62,7 +62,7 @@ module.exports = (bot) => {
|
||||
};
|
||||
|
||||
if (charactersArray.length > 0) {
|
||||
const result = Strings.ponyApiCharRes
|
||||
const result = Strings.ponyApi.charRes
|
||||
.replace("{input}", userInput)
|
||||
.replace("{name}", charactersArray[0].name)
|
||||
.replace("{alias}", charactersArray[0].alias)
|
||||
@ -79,14 +79,14 @@ module.exports = (bot) => {
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
} else {
|
||||
ctx.reply(Strings.ponyApiNoCharFound, {
|
||||
ctx.reply(Strings.ponyApi.noCharFound, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ctx.reply(Strings.ponyApiErr, {
|
||||
ctx.reply(Strings.ponyApi.apiErr, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
@ -98,7 +98,7 @@ module.exports = (bot) => {
|
||||
const userInput = ctx.message.text.split(' ').slice(1).join(' ');
|
||||
|
||||
if (!userInput) {
|
||||
ctx.reply(Strings.ponyApiNoEpisodeNum, {
|
||||
ctx.reply(Strings.ponyApi.noEpisodeNum, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
@ -129,7 +129,7 @@ module.exports = (bot) => {
|
||||
};
|
||||
|
||||
if (episodeArray.length > 0) {
|
||||
const result = Strings.ponyApiEpRes
|
||||
const result = Strings.ponyApi.epRes
|
||||
.replace("{input}", userInput)
|
||||
.replace("{name}", episodeArray[0].name)
|
||||
.replace("{url}", episodeArray[0].url)
|
||||
@ -148,14 +148,14 @@ module.exports = (bot) => {
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
} else {
|
||||
ctx.reply(Strings.ponyApiNoEpisodeFound, {
|
||||
ctx.reply(Strings.ponyApi.noEpisodeFound, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ctx.reply(Strings.ponyApiErr, {
|
||||
ctx.reply(Strings.ponyApi.apiErr, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
@ -168,7 +168,7 @@ module.exports = (bot) => {
|
||||
// const userInput = ctx.message.text.split(' ').slice(1).join(' ');
|
||||
|
||||
// if (!userInput) {
|
||||
// ctx.reply(Strings.ponyApiNoComicName, {
|
||||
// ctx.reply(Strings.ponyApi.noComicName, {
|
||||
// parse_mode: 'Markdown',
|
||||
// reply_to_message_id: ctx.message.message_id
|
||||
// });
|
||||
@ -198,7 +198,7 @@ module.exports = (bot) => {
|
||||
// };
|
||||
|
||||
// if (comicArray.length > 0) {
|
||||
// const result = Strings.ponyApiComicRes
|
||||
// const result = Strings.ponyApi.comicRes
|
||||
// .replace("{input}", userInput)
|
||||
// .replace("{name}", comicArray[0].name)
|
||||
// .replace("{series}", comicArray[0].series)
|
||||
@ -216,14 +216,14 @@ module.exports = (bot) => {
|
||||
// reply_to_message_id: ctx.message.message_id
|
||||
// });
|
||||
// } else {
|
||||
// ctx.reply(Strings.ponyApiNoComicFound, {
|
||||
// ctx.reply(Strings.ponyApi.noComicFound, {
|
||||
// parse_mode: 'Markdown',
|
||||
// reply_to_message_id: ctx.message.message_id
|
||||
// });
|
||||
// };
|
||||
// } catch (error) {
|
||||
// console.error(error);
|
||||
// ctx.reply(Strings.ponyApiErr, {
|
||||
// ctx.reply(Strings.ponyApi.apiErr, {
|
||||
// parse_mode: 'Markdown',
|
||||
// reply_to_message_id: ctx.message.message_id
|
||||
// });
|
||||
|
@ -90,14 +90,16 @@
|
||||
"httpCodeErr": "An error occurred while fetching the HTTP code.",
|
||||
"httpCodeNotFound": "HTTP code not found.",
|
||||
"httpCodeResult": "*HTTP Code*: {code}\n*Name*: `{message}`\n*Description*: {description}",
|
||||
"ponyApiCharRes": "*MLP Character Information for* \"`{input}`\"*:*\n\n*Name:* `{name}`\n*Alias*: `{alias}`\n*Fandom URL:* [{url}]({url})\n*Sex:* `{sex}`\n*Residence:* `{residence}`\n*Occupation:* `{occupation}`\n*Kind:* `{kind}`",
|
||||
"ponyApiEpRes": "*MLP Episode Information for* \"`{input}`\"*:*\n\n*Name:* `{name}`\n*Fandom URL:* [{url}]({url})\n*Season:* `{season}`\n*Episode:* `{episode}`\n*Overall Ep.:* `{overall}`\n*Release date:* `{airdate}`\n*Story by:* `{storyby}`\n*Written by:* `{writtenby}`\n*Storyboard:* `{storyboard}`",
|
||||
"ponyApiComicRes": "*MLP Comic Information for* \"`{input}`\"*:*\n\n*Name:* `{name}`\n*Fandom URL:* [{url}]({url})\n*Series:* `{series}`\n*Writer:* `{writer}`\n*Artist:* `{artist}`\n*Colorist:* `{colorist}`\n*Letterer:* `{letterer}`\n*Editor:* `{editor}`",
|
||||
"ponyApiNoCharName": "Please provide the character's name.",
|
||||
"ponyApiNoCharFound": "No character found.",
|
||||
"ponyApiNoEpisodeNum": "Please provide the episode's number.",
|
||||
"ponyApiNoEpisodeFound": "No episode found.",
|
||||
"ponyApiNoComicName": "Please provide the comic's name.",
|
||||
"ponyApiNoComicFound": "No comic found.",
|
||||
"ponyApiErr": "An error occurred while fetching data from the API."
|
||||
"ponyApi": {
|
||||
"charRes": "*MLP Character Information for* \"`{input}`\"*:*\n\n*Name:* `{name}`\n*Alias*: `{alias}`\n*Fandom URL:* [{url}]({url})\n*Sex:* `{sex}`\n*Residence:* `{residence}`\n*Occupation:* `{occupation}`\n*Kind:* `{kind}`",
|
||||
"epRes": "*MLP Episode Information for* \"`{input}`\"*:*\n\n*Name:* `{name}`\n*Fandom URL:* [{url}]({url})\n*Season:* `{season}`\n*Episode:* `{episode}`\n*Overall Ep.:* `{overall}`\n*Release date:* `{airdate}`\n*Story by:* `{storyby}`\n*Written by:* `{writtenby}`\n*Storyboard:* `{storyboard}`",
|
||||
"comicRes": "*MLP Comic Information for* \"`{input}`\"*:*\n\n*Name:* `{name}`\n*Fandom URL:* [{url}]({url})\n*Series:* `{series}`\n*Writer:* `{writer}`\n*Artist:* `{artist}`\n*Colorist:* `{colorist}`\n*Letterer:* `{letterer}`\n*Editor:* `{editor}`",
|
||||
"noCharName": "Please provide the character's name.",
|
||||
"noCharFound": "No character found.",
|
||||
"noEpisodeNum": "Please provide the episode's number.",
|
||||
"noEpisodeFound": "No episode found.",
|
||||
"noComicName": "Please provide the comic's name.",
|
||||
"noComicFound": "No comic found.",
|
||||
"apiErr": "An error occurred while fetching data from the API."
|
||||
}
|
||||
}
|
@ -90,13 +90,15 @@
|
||||
"httpCodeErr": "Ocorreu um erro ao buscar o código HTTP.",
|
||||
"httpCodeNotFound": "Código HTTP não encontrado.",
|
||||
"httpCodeResult": "*Código HTTP*: `{code}`\n*Nome*: `{message}`\n*Descrição*: `{description}`",
|
||||
"ponyApiCharRes": "*Informações do Personagem de MLP para* `{input}`*:*\n\n*Nome:* `{name}`\n*Apelido:* `{alias}`\n*URL do Fandom:* [{url}]({url})\n*Sexo:* `{sex}`\n*Residência:* `{residence}`\n*Ocupação:* `{occupation}`\n*Tipo:* `{kind}`",
|
||||
"ponyApiEpRes": "*Informações do Episódio de MLP para* `{input}`*:*\n\n*Nome:* `{name}`\n*URL do Fandom:* [{url}]({url})\n*Temporada:* `{season}`\n*Episódio:* `{episode}`\n*Episódio Geral:* `{overall}`\n*Data de Lançamento:* `{airdate}`\n*História por:* `{storyby}`\n*Escrito por:* `{writtenby}`\n*Storyboard:* `{storyboard}`",
|
||||
"ponyApiNoCharName": "Por favor, forneça o nome do personagem.",
|
||||
"ponyApiNoCharFound": "Nenhum personagem encontrado.",
|
||||
"ponyApiNoEpisodeNum": "Por favor, forneça o número do episódio.",
|
||||
"ponyApiNoEpisodeFound": "Nenhum episódio encontrado.",
|
||||
"ponyApiNoComicName": "Por favor, forneça o nome da comic.",
|
||||
"ponyApiNoComicFound": "Nenhuma comic foi encontrada.",
|
||||
"ponyApiErr": "Ocorreu um erro ao buscar dados da API."
|
||||
"ponyApi": {
|
||||
"charRes": "*Informações do Personagem de MLP para* `{input}`*:*\n\n*Nome:* `{name}`\n*Apelido:* `{alias}`\n*URL do Fandom:* [{url}]({url})\n*Sexo:* `{sex}`\n*Residência:* `{residence}`\n*Ocupação:* `{occupation}`\n*Tipo:* `{kind}`",
|
||||
"epRes": "*Informações do Episódio de MLP para* `{input}`*:*\n\n*Nome:* `{name}`\n*URL do Fandom:* [{url}]({url})\n*Temporada:* `{season}`\n*Episódio:* `{episode}`\n*Episódio Geral:* `{overall}`\n*Data de Lançamento:* `{airdate}`\n*História por:* `{storyby}`\n*Escrito por:* `{writtenby}`\n*Storyboard:* `{storyboard}`",
|
||||
"noCharName": "Por favor, forneça o nome do personagem.",
|
||||
"noCharFound": "Nenhum personagem encontrado.",
|
||||
"noEpisodeNum": "Por favor, forneça o número do episódio.",
|
||||
"noEpisodeFound": "Nenhum episódio encontrado.",
|
||||
"noComicName": "Por favor, forneça o nome da comic.",
|
||||
"noComicFound": "Nenhuma comic foi encontrada.",
|
||||
"apiErr": "Ocorreu um erro ao buscar dados da API."
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user