mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
Put all MLP strings on another JSON object
This commit is contained in:
parent
87280cab21
commit
e6fec9abe8
@ -208,9 +208,10 @@ module.exports = (bot) => {
|
|||||||
return ctx.reply("No phones found.", { reply_to_message_id: ctx.message.message_id });
|
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 = {
|
const options = {
|
||||||
parse_mode: 'HTML',
|
parse_mode: 'HTML',
|
||||||
|
reply_to_message_id: ctx.message.message_id,
|
||||||
disable_web_page_preview: true,
|
disable_web_page_preview: true,
|
||||||
reply_markup: {
|
reply_markup: {
|
||||||
inline_keyboard: results.map(result => [{ text: result.name, callback_data: `details:${result.url}:${ctx.from.id}` }])
|
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) {
|
if (phoneDetails.name) {
|
||||||
const message = formatPhone(phoneDetails);
|
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 {
|
} else {
|
||||||
ctx.reply("Error fetching phone details.", { reply_to_message_id: ctx.message.message_id });
|
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(' ');
|
const userInput = ctx.message.text.split(' ').slice(1).join(' ');
|
||||||
|
|
||||||
if (!userInput) {
|
if (!userInput) {
|
||||||
ctx.reply(Strings.ponyApiNoCharName, {
|
ctx.reply(Strings.ponyApi.noCharName, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
});
|
});
|
||||||
@ -62,7 +62,7 @@ module.exports = (bot) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (charactersArray.length > 0) {
|
if (charactersArray.length > 0) {
|
||||||
const result = Strings.ponyApiCharRes
|
const result = Strings.ponyApi.charRes
|
||||||
.replace("{input}", userInput)
|
.replace("{input}", userInput)
|
||||||
.replace("{name}", charactersArray[0].name)
|
.replace("{name}", charactersArray[0].name)
|
||||||
.replace("{alias}", charactersArray[0].alias)
|
.replace("{alias}", charactersArray[0].alias)
|
||||||
@ -79,14 +79,14 @@ module.exports = (bot) => {
|
|||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ctx.reply(Strings.ponyApiNoCharFound, {
|
ctx.reply(Strings.ponyApi.noCharFound, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
ctx.reply(Strings.ponyApiErr, {
|
ctx.reply(Strings.ponyApi.apiErr, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
});
|
});
|
||||||
@ -98,7 +98,7 @@ module.exports = (bot) => {
|
|||||||
const userInput = ctx.message.text.split(' ').slice(1).join(' ');
|
const userInput = ctx.message.text.split(' ').slice(1).join(' ');
|
||||||
|
|
||||||
if (!userInput) {
|
if (!userInput) {
|
||||||
ctx.reply(Strings.ponyApiNoEpisodeNum, {
|
ctx.reply(Strings.ponyApi.noEpisodeNum, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
});
|
});
|
||||||
@ -129,7 +129,7 @@ module.exports = (bot) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (episodeArray.length > 0) {
|
if (episodeArray.length > 0) {
|
||||||
const result = Strings.ponyApiEpRes
|
const result = Strings.ponyApi.epRes
|
||||||
.replace("{input}", userInput)
|
.replace("{input}", userInput)
|
||||||
.replace("{name}", episodeArray[0].name)
|
.replace("{name}", episodeArray[0].name)
|
||||||
.replace("{url}", episodeArray[0].url)
|
.replace("{url}", episodeArray[0].url)
|
||||||
@ -148,14 +148,14 @@ module.exports = (bot) => {
|
|||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
ctx.reply(Strings.ponyApiNoEpisodeFound, {
|
ctx.reply(Strings.ponyApi.noEpisodeFound, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
ctx.reply(Strings.ponyApiErr, {
|
ctx.reply(Strings.ponyApi.apiErr, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
});
|
});
|
||||||
@ -168,7 +168,7 @@ module.exports = (bot) => {
|
|||||||
// const userInput = ctx.message.text.split(' ').slice(1).join(' ');
|
// const userInput = ctx.message.text.split(' ').slice(1).join(' ');
|
||||||
|
|
||||||
// if (!userInput) {
|
// if (!userInput) {
|
||||||
// ctx.reply(Strings.ponyApiNoComicName, {
|
// ctx.reply(Strings.ponyApi.noComicName, {
|
||||||
// parse_mode: 'Markdown',
|
// parse_mode: 'Markdown',
|
||||||
// reply_to_message_id: ctx.message.message_id
|
// reply_to_message_id: ctx.message.message_id
|
||||||
// });
|
// });
|
||||||
@ -198,7 +198,7 @@ module.exports = (bot) => {
|
|||||||
// };
|
// };
|
||||||
|
|
||||||
// if (comicArray.length > 0) {
|
// if (comicArray.length > 0) {
|
||||||
// const result = Strings.ponyApiComicRes
|
// const result = Strings.ponyApi.comicRes
|
||||||
// .replace("{input}", userInput)
|
// .replace("{input}", userInput)
|
||||||
// .replace("{name}", comicArray[0].name)
|
// .replace("{name}", comicArray[0].name)
|
||||||
// .replace("{series}", comicArray[0].series)
|
// .replace("{series}", comicArray[0].series)
|
||||||
@ -216,14 +216,14 @@ module.exports = (bot) => {
|
|||||||
// reply_to_message_id: ctx.message.message_id
|
// reply_to_message_id: ctx.message.message_id
|
||||||
// });
|
// });
|
||||||
// } else {
|
// } else {
|
||||||
// ctx.reply(Strings.ponyApiNoComicFound, {
|
// ctx.reply(Strings.ponyApi.noComicFound, {
|
||||||
// parse_mode: 'Markdown',
|
// parse_mode: 'Markdown',
|
||||||
// reply_to_message_id: ctx.message.message_id
|
// reply_to_message_id: ctx.message.message_id
|
||||||
// });
|
// });
|
||||||
// };
|
// };
|
||||||
// } catch (error) {
|
// } catch (error) {
|
||||||
// console.error(error);
|
// console.error(error);
|
||||||
// ctx.reply(Strings.ponyApiErr, {
|
// ctx.reply(Strings.ponyApi.apiErr, {
|
||||||
// parse_mode: 'Markdown',
|
// parse_mode: 'Markdown',
|
||||||
// reply_to_message_id: ctx.message.message_id
|
// reply_to_message_id: ctx.message.message_id
|
||||||
// });
|
// });
|
||||||
|
@ -90,14 +90,16 @@
|
|||||||
"httpCodeErr": "An error occurred while fetching the HTTP code.",
|
"httpCodeErr": "An error occurred while fetching the HTTP code.",
|
||||||
"httpCodeNotFound": "HTTP code not found.",
|
"httpCodeNotFound": "HTTP code not found.",
|
||||||
"httpCodeResult": "*HTTP Code*: {code}\n*Name*: `{message}`\n*Description*: {description}",
|
"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}`",
|
"ponyApi": {
|
||||||
"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}`",
|
"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}`",
|
||||||
"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}`",
|
"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}`",
|
||||||
"ponyApiNoCharName": "Please provide the character's name.",
|
"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}`",
|
||||||
"ponyApiNoCharFound": "No character found.",
|
"noCharName": "Please provide the character's name.",
|
||||||
"ponyApiNoEpisodeNum": "Please provide the episode's number.",
|
"noCharFound": "No character found.",
|
||||||
"ponyApiNoEpisodeFound": "No episode found.",
|
"noEpisodeNum": "Please provide the episode's number.",
|
||||||
"ponyApiNoComicName": "Please provide the comic's name.",
|
"noEpisodeFound": "No episode found.",
|
||||||
"ponyApiNoComicFound": "No comic found.",
|
"noComicName": "Please provide the comic's name.",
|
||||||
"ponyApiErr": "An error occurred while fetching data from the API."
|
"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.",
|
"httpCodeErr": "Ocorreu um erro ao buscar o código HTTP.",
|
||||||
"httpCodeNotFound": "Código HTTP não encontrado.",
|
"httpCodeNotFound": "Código HTTP não encontrado.",
|
||||||
"httpCodeResult": "*Código HTTP*: `{code}`\n*Nome*: `{message}`\n*Descrição*: `{description}`",
|
"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}`",
|
"ponyApi": {
|
||||||
"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}`",
|
"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}`",
|
||||||
"ponyApiNoCharName": "Por favor, forneça o nome do personagem.",
|
"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}`",
|
||||||
"ponyApiNoCharFound": "Nenhum personagem encontrado.",
|
"noCharName": "Por favor, forneça o nome do personagem.",
|
||||||
"ponyApiNoEpisodeNum": "Por favor, forneça o número do episódio.",
|
"noCharFound": "Nenhum personagem encontrado.",
|
||||||
"ponyApiNoEpisodeFound": "Nenhum episódio encontrado.",
|
"noEpisodeNum": "Por favor, forneça o número do episódio.",
|
||||||
"ponyApiNoComicName": "Por favor, forneça o nome da comic.",
|
"noEpisodeFound": "Nenhum episódio encontrado.",
|
||||||
"ponyApiNoComicFound": "Nenhuma comic foi encontrada.",
|
"noComicName": "Por favor, forneça o nome da comic.",
|
||||||
"ponyApiErr": "Ocorreu um erro ao buscar dados da API."
|
"noComicFound": "Nenhuma comic foi encontrada.",
|
||||||
|
"apiErr": "Ocorreu um erro ao buscar dados da API."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user