diff --git a/app.js b/app.js index 67fcc07..4e9e5b2 100644 --- a/app.js +++ b/app.js @@ -16,7 +16,7 @@ const bot_welcome = require('./data/bot/welcomeMesage') const bot_questions = require('./data/bot/questions') const bot_football = require('./data/bot/requests/football') const bot_joke = require('./data/bot/requests/joke') -const bot_faq_subscriptions = require('./data/bot/faq/subscriptions') +const bot_faq_subscription = require('./data/bot/faq/subscriptions') const token = process.env.BOT_TOKEN; const name = process.env.BOT_NAME; @@ -65,8 +65,7 @@ bot.on('message', (msg) => { // listen for "what sub should i buy?" bot_questions.whatSubShouldIBuy(bot, msg, logger) - bot_faq_subscriptions.prices(bot, msg, logger) - + bot_faq_subscription.prices(bot, msg, logger) diff --git a/data/bot/faq/subscriptions.js b/data/bot/faq/subscriptions.js index e424240..5f24301 100644 --- a/data/bot/faq/subscriptions.js +++ b/data/bot/faq/subscriptions.js @@ -1,33 +1,18 @@ -const fs = require('fs'); -const {table} = require('table') -const subs = JSON.parse(fs.readFileSync('./data/group/subs.json', 'utf8')) -const t = require('obj-array-table') -const nodeHtmlToImage = require('node-html-to-image') - -var arrayToTable = require('array-to-table') - - module.exports = { prices: (bot, msg, logger) => { const subPrice = "- subscription prices"; if (msg.text && msg.text.toString().toLowerCase() === subPrice) { logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " Got subscription Prices"); - - - let test = arrayToTable(subs) - - let t = "
" + test + "
" - - nodeHtmlToImage({ - output: './image.png', - html: t - }) - - bot.sendMessage(msg.chat.id, - `First Header | Second Header - ------------- | ------------- - Content Cell | Content Cell - Content Cell | Content Cell`, { parse_mode: "Markdown" }) + bot.sendMessage(msg.chat.id, ` + PREMIUM PLUS ----£30\n + VIP-----------------------£25\n + OLD PREMIUM -----£17\n + BLUEMOON ---------£15\n + KDB --------------------£14\n + GOLD ------------------£13\n + TECHNOID -----------£13\n + BRONZE --------------£10\n + SOL ---------------------£10`) .then(() => { return bot.sendMessage(msg.chat.id, "All of these prices are for 12 Month subscription subs").then(() => { return bot.sendMessage(msg.chat.id, "Keep an eye out though because we offer special deals on different subs from time to time.") @@ -35,4 +20,4 @@ module.exports = { }) } } -} \ No newline at end of file +} diff --git a/image.png b/image.png deleted file mode 100644 index d109df2..0000000 Binary files a/image.png and /dev/null differ