From 542d0c8f657181841db2d73928c2ac124b09f6b2 Mon Sep 17 00:00:00 2001 From: Robin Glauser Date: Fri, 4 Sep 2020 17:21:28 +0200 Subject: [PATCH] Adding version checker --- bot.js | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bot.js b/bot.js index 6e0e771..baec9d5 100644 --- a/bot.js +++ b/bot.js @@ -4,6 +4,9 @@ const {Flatastic} = require('./flatastic.js') require('dotenv').config() +var pjson = require('./package.json'); + + let flatastic = new Flatastic(process.env.FLATASTIC_TOKEN) const bot = new Telegraf(process.env.BOT_TOKEN) @@ -20,6 +23,10 @@ flatastic.getInformation(function (data) { }) +bot.hears(/version/i, (ctx) => { + ctx.replyWithHTML( pjson.version); +}) + bot.hears(/einkaufsliste|ichoufe|einkaufen|kaufen|shopping/i, (ctx) => { flatastic.getShoppingList(function (data) { var output = ""; diff --git a/package.json b/package.json index a9b27b1..6c5b486 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "telegram-flatastic-bot", - "version": "0.0.1", + "version": "0.0.2", "description": "A telegram bot for flatastic", "main": "bot.js", "dependencies": {