Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
nahakiole committed Nov 17, 2020
2 parents bbbf30b + c821f3d commit 36a50ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ const LocalSession = require('telegraf-session-local')

require('dotenv').config()

var pjson = require('./package.json');


let flatastic = new Flatastic(process.env.FLATASTIC_TOKEN)

const bot = new Telegraf(process.env.BOT_TOKEN)

bot.use((new LocalSession({database: 'example_db.json'})).middleware())

bot.start((ctx) => ctx.reply('Welcome!'))
bot.help((ctx) => ctx.reply('Send me a sticker'))
bot.help((ctx) => ctx.reply('Frag mich welche Tasks offen sind 😉'))

let users = {}
flatastic.getInformation(function (data) {
Expand Down Expand Up @@ -90,6 +93,10 @@ cron.schedule('0 12 * * *', () => {
})
});

bot.hears(/version/i, (ctx) => {
ctx.replyWithHTML( "Ich bin auf Version "+pjson.version);
})

bot.hears(/einkaufsliste|ichoufe|einkaufen|kaufen|shopping/i, (ctx) => {
console.dir(ctx.update.message.chat)
flatastic.getShoppingList(function (data) {
Expand Down Expand Up @@ -123,7 +130,7 @@ bot.hears(/counter/i, (ctx, next) => {
return next()
})

bot.hears(/task|aufgabe|ämtli/i, (ctx) => {
bot.hears(/task|aufgabe|ämtli|ufgabe/i, (ctx) => {

flatastic.getTaskList(function (data) {
var tasks = "";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 36a50ff

Please sign in to comment.