Skip to content

ShinkarenkoMaxim/simple-quiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple quiz Telegram Web App example

Inspired by zubiden/tg-web-bot-demo.

Demo bot: @yaqb_bot

What this bot can do?

This bot demonstrates how to develop Telegram bots with WebApp feature and simple setup backend with express.js and grammyjs

webapp-vanilla is used in the project.

What is important?

  • Keyboard Button use to additional Bot UI, because user data is not passed
  • Inline Button use to handle user data like language and user id. It's useful for more loaded components like forms
  • It is advisable not to use JQuery and build the project with Vite, Parcel or other modern bundlers.
  • Be sure to use dark and light themes.

Installation and local launch in DEVELOPMENT mode

  1. Clone this repo: git clone https://github.com/ShinkarenkoMaxim/simple-quiz
  2. Create .env file with the environment variables listed below
  3. Run yarn in the root folder
  4. Run yarn build
  5. Run yarn serve and yarn bot separately

If you want to add several features then you can create directory public/feature and add to this directory your component and serve static file like in example:

app.use('feature', express.static('feature'));

Environment variables in .env file

  • PORT - port number for listen server
  • HOST - hostname or your server ip address. For local development use Ngrok tunnel
  • BOT_TOKEN - telegram bot token

About

Simple quiz bot with Web App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published