Giter Club home page Giter Club logo

scan-tool-bot's Introduction

๐Ÿค– Scan Tool Bot

Open in Telegram
or
just type @ScanToolBot in message input field

Features

  • Scan QR codes with a camera
  • Generate QR codes
  • Works in any chat via inline mode

Launch

  1. Close repository:
git clone [email protected]:bot-base/scan-tool-bot.git
  1. Create an environment variables file:
cp .env.example .env
  1. Launch web app following the instructions in webapp/README.md.

  2. Set BOT_TOKEN, WEBAPP_URL, API_URL environment variables in .env file.

  3. Launch bot

    Development mode:

    # 1. Install dependencies
    npm i
    
    # 2. Set BOT_SERVER_HOST to localhost
    # Set BOT_SERVER_PORT to any available port
    
    # 2. Run bot (in watch mode)
    npm run dev

    Production mode:

    # 1. Install dependencies
    npm i --only=prod
    
    # 2. Set NODE_ENV to production
    # Change BOT_WEBHOOK to the actual URL to receive updates
    
    # 3. Run bot
    npm start 
    # or
    npm run start:force # if you want to skip type checking

List of available commands

  • npm run lint โ€” Lint source code.
  • npm run format โ€” Format source code.
  • npm run typecheck โ€” Runs type checking.
  • npm run dev โ€” Starts the bot in development mode.
  • npm run start โ€” Starts the bot.
  • npm run start:force โ€” Starts the bot without type checking.

Environment Variables

Variable Type Description
NODE_ENV String Application environment (development or production)
BOT_TOKEN String Token, get it from @BotFather.
BOT_WEBHOOK String Webhook endpoint, used to configure webhook in production environment.
WEBAPP_URL String HTTPS link to Web App.
API_URL String `/api` endpoint (must be public and available to Telegram)
LOG_LEVEL String Optional. Application log level. See Pino docs for a complete list of available log levels.
Defaults to info.
BOT_SERVER_HOST String Optional. Server address.
Defaults to 0.0.0.0.
BOT_SERVER_PORT Number Optional. Server port.
Defaults to 80.
BOT_ALLOWED_UPDATES Array of String Optional. A JSON-serialized list of the update types you want your bot to receive. See Update for a complete list of available update types.
Defaults to an empty array (all update types except chat_member).
BOT_ADMIN_USER_ID Number or
Array of Number
Optional. Administrator user ID. Commands such as /setcommands will only be available to a user with this ID.
Defaults to an empty array.

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.