1
- <h1 align =" center " >🤖 Telegram Bot Template </h1 >
1
+ <h1 align =" center " >🤖 Scan Tool Bot </h1 >
2
2
3
- <img align =" right " width =" 35% " src =" https://github.com/bot-base/telegram-bot-template /assets/26162440/c4371683-3e99-4b1c-ae8e-11ccbea78f4b " >
3
+ <img align =" right " width =" 35% " src =" https://github.com/bot-base/scan-tool-bot /assets/26162440/92e1e035-a3d7-4f0f-b5f8-0c40f96a60ec " >
4
4
5
- Bot starter template based on [ grammY] ( https://grammy.dev/ ) bot framework.
5
+ <p align =" center " >
6
+ <a href =" https://t.me/ScanToolBot " >Open in Telegram</a >
7
+ <br /> or
8
+ <br />
9
+ just type <code >@ScanToolBot </code > in message input field
10
+
11
+ </p >
6
12
7
13
## Features
8
14
9
- - Scalable structure
10
- - Config loading and validation
11
- - Internationalization, language changing
12
- - Graceful shutdown
13
- - Logger (powered by [ pino] ( https://github.com/pinojs/pino ) )
14
- - Fast and low overhead server (powered by [ fastify] ( https://github.com/fastify/fastify ) )
15
- - Ready-to-use deployment setups:
16
- - [ Docker] ( #docker-dockercom )
17
- - [ Vercel] ( #vercel-vercelcom )
18
- - Examples:
19
- - [ Prisma ORM] ( #prisma-orm-prismaio )
20
- - grammY plugins:
21
- - [ Conversations] ( #grammy-conversations-grammydevpluginsconversations )
22
- - [ Runner] ( #grammy-runner-grammydevpluginsrunner )
23
- - Web Apps:
24
- - [ Vanilla] ( #web-app-vite-typescript ) (No frameworks)
25
- - [ Vue] ( #web-app-with-vue-vue-vite-typescript )
26
-
27
- ## Usage
28
-
29
- 1 . [ Create a new repository] ( https://github.com/bot-base/telegram-bot-template/generate ) using this template.
15
+ - Scan QR codes with a camera
16
+ - Generate QR codes
17
+ - Works in any chat via inline mode
18
+
19
+ ## Launch
20
+
21
+ 1 . Close repository:
22
+
23
+ ``` sh
24
+ git clone git@github.com:bot-base/scan-tool-bot.git
25
+ ```
30
26
31
27
2 . Create an environment variables file:
32
28
33
29
``` bash
34
30
cp .env.example .env
35
31
```
36
32
37
- 3 . Set BOT_TOKEN [ environment variable ] ( #environment-variables ) in ` .env ` file .
33
+ 3 . Launch web app following the instructions in [ webapp/README.md ] ( webapp/README.md ) .
38
34
35
+ 4 . Set BOT_TOKEN, WEBAPP_URL, API_URL [ environment variables] ( #environment-variables ) in ` .env ` file.
39
36
40
- 4 . Launch bot
37
+ 5 . Launch bot
41
38
42
39
Development mode:
43
40
44
41
``` bash
45
42
# 1. Install dependencies
46
43
npm i
47
44
45
+ # 2. Set BOT_SERVER_HOST to localhost
46
+ # Set BOT_SERVER_PORT to any available port
47
+
48
48
# 2. Run bot (in watch mode)
49
49
npm run dev
50
50
```
@@ -55,7 +55,8 @@ cp .env.example .env
55
55
# 1. Install dependencies
56
56
npm i --only=prod
57
57
58
- # 2. Set NODE_ENV to production and change BOT_WEBHOOK to the actual URL to receive updates
58
+ # 2. Set NODE_ENV to production
59
+ # Change BOT_WEBHOOK to the actual URL to receive updates
59
60
60
61
# 3. Run bot
61
62
npm start
@@ -71,157 +72,6 @@ cp .env.example .env
71
72
- ` npm run start` — Starts the bot.
72
73
- ` npm run start:force` — Starts the bot without type checking.
73
74
74
- # # Deploy
75
-
76
- # ## Docker ([docker.com](https://docker.com))
77
-
78
- Branch:
79
- [deploy/docker-compose](https://github.com/bot-base/telegram-bot-template/tree/deploy/docker-compose)
80
- ([open diff](https://github.com/bot-base/telegram-bot-template/compare/deploy/docker-compose))
81
-
82
- Use in your project:
83
-
84
- 1. Add the template repository as a remote
85
-
86
- ` ` ` sh
87
- git remote add template git@github.com:bot-base/telegram-bot-template.git
88
- git remote update
89
- ` ` `
90
-
91
- 2. Merge deployment setup
92
-
93
- ` ` ` sh
94
- git merge template/deploy/docker-compose -X theirs --squash --no-commit --allow-unrelated-histories
95
- ` ` `
96
-
97
- # ## Vercel ([vercel.com](https://vercel.com))
98
-
99
- Branch:
100
- [deploy/vercel](https://github.com/bot-base/telegram-bot-template/tree/deploy/vercel)
101
- ([open diff](https://github.com/bot-base/telegram-bot-template/compare/deploy/vercel))
102
-
103
- Use in your project:
104
-
105
- 1. Add the template repository as a remote
106
-
107
- ` ` ` sh
108
- git remote add template git@github.com:bot-base/telegram-bot-template.git
109
- git remote update
110
- ` ` `
111
-
112
- 2. Merge deployment setup
113
-
114
- ` ` ` sh
115
- git merge template/deploy/vercel -X theirs --squash --no-commit --allow-unrelated-histories
116
- ` ` `
117
-
118
- # # Examples
119
-
120
- # ## Prisma ORM ([prisma.io](https://prisma.io))
121
-
122
- Branch:
123
- [example/orm-prisma](https://github.com/bot-base/telegram-bot-template/tree/example/orm-prisma)
124
- ([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/orm-prisma))
125
-
126
- Use in your project:
127
-
128
- 1. Add the template repository as a remote
129
-
130
- ` ` ` sh
131
- git remote add template git@github.com:bot-base/telegram-bot-template.git
132
- git remote update
133
- ` ` `
134
-
135
- 2. Merge example
136
-
137
- ` ` ` sh
138
- git merge template/example/orm-prisma -X theirs --squash --no-commit --allow-unrelated-histories
139
- ` ` `
140
-
141
- # ## grammY conversations ([grammy.dev/plugins/conversations](https://grammy.dev/plugins/conversations))
142
-
143
- Branch:
144
- [example/plugin-conversations](https://github.com/bot-base/telegram-bot-template/tree/example/plugin-conversations)
145
- ([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/plugin-conversations))
146
-
147
- Use in your project:
148
-
149
- 1. Add the template repository as a remote
150
-
151
- ` ` ` sh
152
- git remote add template git@github.com:bot-base/telegram-bot-template.git
153
- git remote update
154
- ` ` `
155
-
156
- 2. Merge example
157
-
158
- ` ` ` sh
159
- git merge template/example/plugin-conversations -X theirs --squash --no-commit --allow-unrelated-histories
160
- ` ` `
161
-
162
- # ## grammY runner ([grammy.dev/plugins/runner](https://grammy.dev/plugins/runner))
163
-
164
- Branch:
165
- [example/plugin-runner](https://github.com/bot-base/telegram-bot-template/tree/example/plugin-runner)
166
- ([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/plugin-runner))
167
-
168
- Use in your project:
169
-
170
- 1. Add the template repository as a remote
171
-
172
- ` ` ` sh
173
- git remote add template git@github.com:bot-base/telegram-bot-template.git
174
- git remote update
175
- ` ` `
176
-
177
- 2. Merge example
178
-
179
- ` ` ` sh
180
- git merge template/example/plugin-runner -X theirs --squash --no-commit --allow-unrelated-histories
181
- ` ` `
182
-
183
- # ## Web App ([Vite](https://vitejs.dev), TypeScript)
184
-
185
- Branch:
186
- [example/webapp](https://github.com/bot-base/telegram-bot-template/tree/example/webapp)
187
- ([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/webapp))
188
-
189
- Use in your project:
190
-
191
- 1. Add the template repository as a remote
192
-
193
- ` ` ` sh
194
- git remote add template git@github.com:bot-base/telegram-bot-template.git
195
- git remote update
196
- ` ` `
197
-
198
- 2. Merge example
199
-
200
- ` ` ` sh
201
- git merge template/example/webapp -X theirs --squash --no-commit --allow-unrelated-histories
202
- ` ` `
203
-
204
- # ## Web App with Vue ([Vue](https://vuejs.org), [Vite](https://vitejs.dev), TypeScript)
205
-
206
- Branch:
207
- [example/webapp-vue](https://github.com/bot-base/telegram-bot-template/tree/example/webapp-vue)
208
- ([open diff](https://github.com/bot-base/telegram-bot-template/compare/example/webapp-vue))
209
-
210
- Use in your project:
211
-
212
- 1. Add the template repository as a remote
213
-
214
- ` ` ` sh
215
- git remote add template git@github.com:bot-base/telegram-bot-template.git
216
- git remote update
217
- ` ` `
218
-
219
- 2. Merge example
220
-
221
- ` ` ` sh
222
- git merge template/example/webapp-vue -X theirs --squash --no-commit --allow-unrelated-histories
223
- ` ` `
224
-
225
75
# # Environment Variables
226
76
227
77
| Variable | Description |
@@ -234,3 +84,5 @@ git merge template/example/webapp-vue -X theirs --squash --no-commit --allow-unr
234
84
| BOT_TOKEN | Token, get it from [@BotFather](https://t.me/BotFather) |
235
85
| BOT_WEBHOOK | < details><summary> Webhook endpoint< /summary> Will be used to setup webhook in production mode.< /details> |
236
86
| BOT_ADMIN_USER_ID | < details><summary> Administrator user ID< /summary> Commands, such as ` /setcommands` , will only be available to the user with this ID.< /details> |
87
+ | WEBAPP_URL | HTTPS link to web app |
88
+ | API_URL | ` /api` endpoint (must be public and available to Telegram) |
0 commit comments