Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bot-base/scan-tool-bot
Scan and create QR codes in Telegram
https://github.com/bot-base/scan-tool-bot
bot grammy grammyjs qrcode qrcode-generator qrcode-scanner telegram telegram-api telegram-bot telegram-bot-api telegram-web-app
Last synced: 2 months ago
JSON representation
Scan and create QR codes in Telegram
- Host: GitHub
- URL: https://github.com/bot-base/scan-tool-bot
- Owner: bot-base
- Created: 2022-04-26T14:15:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-06T07:27:44.000Z (8 months ago)
- Last Synced: 2024-05-06T08:39:29.057Z (8 months ago)
- Topics: bot, grammy, grammyjs, qrcode, qrcode-generator, qrcode-scanner, telegram, telegram-api, telegram-bot, telegram-bot-api, telegram-web-app
- Language: TypeScript
- Homepage: https://t.me/ScanToolBot
- Size: 487 KB
- Stars: 31
- Watchers: 0
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-grammY - bot-base/scan-tool-bot - Scan QR codes with your camera. [á´œsá´‡](https://t.me/ScanToolBot) (Bots)
README
🤖 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:
```sh
git clone [email protected]:bot-base/scan-tool-bot.git
```2. Create an environment variables file:
```bash
cp .env.example .env
```3. Launch web app following the instructions in [webapp/README.md](webapp/README.md).
4. Set BOT_TOKEN, WEBAPP_URL, API_URL [environment variables](#environment-variables) in `.env` file.
5. Launch bot
Development mode:
```bash
# 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:
```bash
# 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
orproduction
)
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 toinfo
.
BOT_SERVER_HOST
String
Optional. Server address.
Defaults to0.0.0.0
.
BOT_SERVER_PORT
Number
Optional. Server port.
Defaults to80
.
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 exceptchat_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.