Update some strings and cleanup unused commands
This commit is contained in:
parent
9cebaad36f
commit
4756e202be
4 changed files with 3 additions and 67 deletions
|
@ -1,28 +0,0 @@
|
|||
// const Resources = require('../props/resources.json');
|
||||
// const { getStrings } = require('../plugins/checkLang.js');
|
||||
// const { isOnSpamWatch } = require('../spamwatch/spamwatch.js');
|
||||
// const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch);
|
||||
// const escape = require('markdown-escape');
|
||||
// const axios = require('axios');
|
||||
|
||||
// module.exports = (bot) => {
|
||||
// bot.command("quote", spamwatchMiddleware, async (ctx) => {
|
||||
// const Strings = getStrings(ctx.from.language_code);
|
||||
|
||||
// try {
|
||||
// const response = await axios.get(Resources.quoteApi);
|
||||
// const data = response.data;
|
||||
|
||||
// ctx.reply(escape(`${escape(Strings.quoteResult)}\n> *${escape(data.quote)}*\n_${escape(data.author)}_`), {
|
||||
// reply_to_message_id: ctx.message.message_id,
|
||||
// parse_mode: 'Markdown'
|
||||
// });
|
||||
// } catch (error) {
|
||||
// console.error(error);
|
||||
// ctx.reply(Strings.quoteErr, {
|
||||
// reply_to_message_id: ctx.message.id,
|
||||
// parse_mode: 'MarkdownV2'
|
||||
// });
|
||||
// };
|
||||
// });
|
||||
// };
|
|
@ -1,36 +0,0 @@
|
|||
// const axios = require("axios");
|
||||
|
||||
// function capitalizeFirstLetter(string) {
|
||||
// return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
// }
|
||||
|
||||
// function mediaWikiToMarkdown(input) {
|
||||
// input = input.replace(/===(.*?)===/g, '*$1*');
|
||||
// input = input.replace(/==(.*?)==/g, '*$1*');
|
||||
// input = input.replace(/=(.*?)=/g, '*$1*');
|
||||
// input = input.replace(/'''(.*?)'''/g, '**$1**');
|
||||
// input = input.replace(/''(.*?)''/g, '_$1_');
|
||||
// input = input.replace(/^\*\s/gm, '- ');
|
||||
// input = input.replace(/^\#\s/gm, '1. ');
|
||||
// input = input.replace(/{{Quote(.*?)}}/g, "```\n$1```\n");
|
||||
// input = input.replace(/\[\[(.*?)\|?(.*?)\]\]/g, (_, link, text) => {
|
||||
// const sanitizedLink = link.replace(/ /g, '_');
|
||||
// return text ? `[${text}](${sanitizedLink})` : `[${sanitizedLink}](${sanitizedLink})`;
|
||||
// });
|
||||
// input = input.replace(/\[\[File:(.*?)\|.*?\]\]/g, '');
|
||||
|
||||
// return input;
|
||||
// }
|
||||
|
||||
// module.exports = (bot) => {
|
||||
// bot.command("wiki", async (ctx) => {
|
||||
// const userInput = capitalizeFirstLetter(ctx.message.text.split(' ')[1]);
|
||||
// const apiUrl = `https://en.wikipedia.org/w/index.php?title=${userInput}&action=raw`;
|
||||
// const response = await axios(apiUrl, { headers: { 'Accept': "text/plain" } });
|
||||
// const convertedResponse = response.data.replace(/<\/?div>/g, "").replace(/{{Infobox.*?}}/s, "");
|
||||
|
||||
// const result = mediaWikiToMarkdown(convertedResponse).slice(0, 2048);
|
||||
|
||||
// ctx.reply(result, { parse_mode: 'Markdown', disable_web_page_preview: true, reply_to_message_id: ctx.message.message_id });
|
||||
// });
|
||||
// };
|
Loading…
Add table
Add a link
Reference in a new issue