Skip to content

Telegram bot for automatic confinement form generation

License

Notifications You must be signed in to change notification settings

david-dego/AttestationBot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AttestationBot

Overview

This Telegram bot generates a custom confinement form on the fly with the ability to specify the creation time/date.

Getting started

To roll your own bot just follow these steps:

  1. Create your bot in Telegram and get the API token, instructions: Creating a new bot.
  2. Use the \setcommands to create the attestation command for your bot.
  3. Send a message to you bot and visit the link https://api.telegram.org/bot**YourBOTToken**/getUpdates in order to retrieve the chat id.
  4. Clone this repository: git clone https://github.com/khllkcm/AttestationBot.git.
  5. Go to the project directory: cd AttestationBot.
  6. Fill out the .env file with your information.
  7. Install the dependencies: npm install.
  8. Make sure to install forever: [sudo] npm install forever -g.
  9. Start the bot: forever src/app.js.

Usage

The main (and only) command is \attestation DELAY.

DELAY is the number of minutes before TIME that will be inscribed as the form creation time. For example, if you plan on leaving your house at 10:00 and you use a delay of 20, the form will have a creation time of 9:40. This is useful for creating a form on the spot but still, #STAYHOME.

The bot will reply asking you for the reasons you will be going out. Tap to select, tap again to deselect.

The bot will inform you of which reasons are currently selected and once you tap DONE it will generate the form.

Disclaimer

The code for generating the PDF file borrows heavily from the official implementation by the French Interior Ministry in order to ensure complete compliance. It is a pure NodeJS version of the ES6 code they used that has been simplified and refactored.

About

Telegram bot for automatic confinement form generation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%