GithubHelp home page GithubHelp logo

agno94 / buonacacciabot Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 259 KB

A nodeJS app that provides a Telegram bot that helps italian scout/guide boys, girls and leaders dealing with buonacaccia.net

Home Page: https://t.me/agnoBuonacacciaBot

License: GNU Lesser General Public License v3.0

JavaScript 98.57% EJS 1.43%
telegram-bot heroku node javascript scout agesci italian-scouts work-in-progress

buonacacciabot's Introduction

BuonacacciaBot

Descrition

A Telegream Bot created to help people dealing with buonacaccia.net, a site used by Italian scouts and guides to subscribe to organized events.

The bot is a program for node.js that uses the node-telegram-bot-api package.

This bot periodically collects the list of events through a process of web-scraping and save it to a SQL database. Telegram user can search the database for selected events or ask to get a notification when an event of a given type shows up. The telegram will also provide notification before the subscription start date and before the event start date.

I run this on Heroku.

Development

Still in progress.

  • Notification before subscription start date and event start date are to be tested.
  • The notification on new events are to be tested properly.
  • The bot does not handle well telegram errors, e.g. those that arise if the bot is stopped by telegram users
  • The bot does not update his database

Setup

  • Create a telegram bot
  • Get the api token and save it to the TELEGRAM_API_TOKEN enviroment variable
  • If you run the bot on a serve that might idle you server add the app path to the APP_URL enviroment variable
  • Provide a PostgreSQL db and the connection information as the DATABASE_URL env variable
  • Run node db-setup.js to set up the database
  • Run node app.js to start the bot
  • If running on Heroku then set up a way to periodicaly search for event: either set up the KEEP_UP to always run the app (consume heroku time); or setup your server to hourly run node job.js
  • If running on Heroku then set up a way to send event alarm:: either set up the KEEP_UP to always run the app; or setup your server to run node wake.js at 8:00 CET and 17:00 CET.

buonacacciabot's People

Contributors

agno94 avatar

Stargazers

Pietro Rampazzo avatar

Watchers

 avatar marcog avatar

buonacacciabot's Issues

Ready to help

Hi, I am also a scout and I would like to help you with this project. I wrote you a PM on Facebook (or at least I think that was your account) to communicate directly, answer me there if you like.

Alcuni comandi non restituiscono risultati

Ciao, ho trovato il tuo bot per caso su telegram ed ho pensato fosse un'ottima idea per poter rimanere sempre aggiornato sugli eventi, senza refreshare costantemente BuonaCaccia.

Ho letto che è ancora in fase di sviluppo e collaudo per questo ho pensato di segnalarti un paio di bug:

  1. Dopo aver selezionato /cerca e successivamente aver scelto un'opzione L/C, E/G, R/S, Campi formazione, Form. permanente, non mi restituisce nessun risultato;
  2. Dopo aver selezionato il comando /osserva e successivamente aver scelto un'opzione L/C, E/G, R/S, Campi formazione, Form. permanente, non mi restituisce nessun messaggio (non so se dovrebbe).

Grazie per il lavoro che stai facendo,
Un saluto

Messaggi non si aggiornano se i contenuti vengono modificati da azione non legate al messaggio

Tipo di problematica

Funzione mancante

Descrizione

Esempi:

  • Se dalla inline-keyboard di un messaggio /annulla vengono eliminati degli osservatori i messaggi degli osservatori stessi (comparsi quando questi furono creati) non cambiano continuando a scrivere di un osservatore attivo quando in realtà è stato eliminato
  • Se della inline-keyboard di un messaggio di descrizione di un evento attivo/disattivo i promemoria per quell'evento lo stato dei promemoria su eventuali messaggi di descrizione del medesimo evento non cambiano.

Gli eventi che mostra il bot non cambiano se modificati su buonacaccia.net

Tipo di problematica

Comportamento sbagliato

Descrizione

Una volta che un evento viene trovato dal bot su buonacaccia ed registrato nel database i suoi dettagli non vengono più controllati. Se i dettagli dell'evento vengono modificati(ad esempio viene posticipato) o se l'evento viene annullato il bot risponde come se l'evento sia presente e con le informazioni salvate la prima volta.

Riproducibilità

Evento annullato, cercare sul bot i CFA di maggio. L'evento CFA Maggio A - Sassello(SV) (https://buonacaccia.net/event.aspx?e=11455) viene elencato anche se annullato.
Evento posticipato, se cercato a fine marzo sul bot i Campi di specialità del Veneto non vengono visualizzati alcuni campi di specialità originariamente programmati per marzo ma poi posticipati (causa virus, poi sarebbero stati annullati) a mesi successivi.

Aggiungere notifiche/promemoria associati a eventi

Tipo di problematica

Funzionalità da aggiungere

Descrizione

Da un messaggio con i dettagli di un "evento" dev'essere possibile cliccare su un button di una inline-keyboard per attivare/disattivare le notifiche relative ad un evento.
Avere le notifiche relative ad un evento attive dovrebbe comportare:

  • ricevere un messaggio il giorno prima delle apertura delle iscrizioni
  • ricevere un messaggio un ora prima delle apertura delle iscrizioni
  • ricevere un messaggio il giorno prima dell'inizio dell'evento
  • ricevere un messaggio il giorno prima della fine dell'evento

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.