diff --git a/src/commands/quotes.js b/src/commands/quotes.js index 5e97b1f..e73e70e 100644 --- a/src/commands/quotes.js +++ b/src/commands/quotes.js @@ -1,30 +1,28 @@ -const Resources = require('../props/resources.json'); -const { getStrings } = require('../plugins/checklang.js'); -const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); -const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); -const axios = require('axios'); +// const Resources = require('../props/resources.json'); +// const { getStrings } = require('../plugins/checklang.js'); +// const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js'); +// const spamwatchMiddleware = require('../plugins/lib-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); +// 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; - const escapedQuote = data.quote.replace(/([\\_*~`>.!-])/g, '\\$1'); - const escapedAuthor = `- ${data.author}.`.replace(/([\\_*~`>.!-])/g, '\\$1'); - const escapedData = `${Strings.quoteResult}\n>*${escapedQuote}*\n_${escapedAuthor}_`; +// try { +// const response = await axios.get(Resources.quoteApi); +// const data = response.data; - ctx.reply(escapedData, { - reply_to_message_id: ctx.message.message_id, - parse_mode: 'MarkdownV2' - }); - } catch (error) { - console.error(error); - ctx.reply(Strings.quoteErr, { - reply_to_message_id: ctx.message.id, - parse_mode: 'MarkdownV2' - }); - }; - }); -}; +// 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' +// }); +// }; +// }); +// };