mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
/mlpcomic (wip, should not be uncommented by now)
This commit is contained in:
parent
fe609e8e03
commit
6947a79f25
@ -161,4 +161,72 @@ module.exports = (bot) => {
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// bot.command("mlpcomic", spamwatchMiddleware, async (ctx) => {
|
||||
// const Strings = getStrings(ctx.from.language_code);
|
||||
// const userInput = ctx.message.text.split(' ').slice(1).join(' ');
|
||||
|
||||
// if (!userInput) {
|
||||
// ctx.reply(Strings.ponyApiNoComicName, {
|
||||
// parse_mode: 'Markdown',
|
||||
// reply_to_message_id: ctx.message.message_id
|
||||
// });
|
||||
// return;
|
||||
// };
|
||||
|
||||
// const apiUrl = `http://ponyapi.net/v1/comics-story/${userInput}`;
|
||||
|
||||
// try {
|
||||
// const response = await axios(apiUrl);
|
||||
// const comicArray = [];
|
||||
// console.log(response.data.data)
|
||||
// if (Array.isArray(response.data.data)) {
|
||||
// response.data.data.forEach(comic => {
|
||||
// comicArray.push({
|
||||
// name: comic.name,
|
||||
// series: comic.series,
|
||||
// image: comic.image,
|
||||
// url: comic.url,
|
||||
// writer: comic.writer ? comic.writer.replace(/\n/g, ' / ') : 'N/A',
|
||||
// artist: comic.artist ? comic.artist.replace(/\n/g, ' / ') : 'N/A',
|
||||
// colorist: comic.colorist ? comic.colorist.replace(/\n/g, ' / ') : 'N/A',
|
||||
// letterer: comic.letterer ? comic.letterer.replace(/\n/g, ' / ') : 'N/A',
|
||||
// editor: comic.editor
|
||||
// });
|
||||
// });
|
||||
// };
|
||||
|
||||
// if (comicArray.length > 0) {
|
||||
// const result = Strings.ponyApiComicRes
|
||||
// .replace("{input}", userInput)
|
||||
// .replace("{name}", comicArray[0].name)
|
||||
// .replace("{series}", comicArray[0].series)
|
||||
// .replace("{url}", comicArray[0].url)
|
||||
// .replace("{writer}", comicArray[0].writer)
|
||||
// .replace("{artist}", comicArray[0].artist)
|
||||
// .replace("{colorist}", comicArray[0].colorist)
|
||||
// .replace("{letterer}", comicArray[0].writtenby)
|
||||
// .replace("{editor}", comicArray[0].editor);
|
||||
|
||||
// ctx.replyWithPhoto(comicArray[0].image, {
|
||||
// caption: `${result}`,
|
||||
// parse_mode: 'Markdown',
|
||||
// disable_web_page_preview: true,
|
||||
// reply_to_message_id: ctx.message.message_id
|
||||
// });
|
||||
// } else {
|
||||
// ctx.reply(Strings.ponyApiNoComicFound, {
|
||||
// parse_mode: 'Markdown',
|
||||
// reply_to_message_id: ctx.message.message_id
|
||||
// });
|
||||
// };
|
||||
// } catch (error) {
|
||||
// console.error(error);
|
||||
// ctx.reply(Strings.ponyApiErr, {
|
||||
// parse_mode: 'Markdown',
|
||||
// reply_to_message_id: ctx.message.message_id
|
||||
// });
|
||||
// };
|
||||
// });
|
||||
};
|
||||
|
@ -84,11 +84,14 @@
|
||||
"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\n*Alias*: `{alias}`\n\n*Fandom URL:* [{url}]({url})\n\n*Sex:* `{sex}`\n\n*Residence:* `{residence}`\n\n*Occupation:* `{occupation}`\n\n*Kind:* `{kind}`",
|
||||
"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."
|
||||
}
|
@ -90,5 +90,7 @@
|
||||
"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."
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user