telegram-badge 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/README.ru.md +78 -3
- package/README.zh.md +24 -0
- package/dist/api/badge-generator.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,9 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/chatman-media/telegram-badge/actions)
|
|
6
6
|
[](https://badge.fury.io/js/telegram-badge)
|
|
7
|
+
[](https://www.npmjs.com/package/telegram-badge)
|
|
8
|
+
[](https://bundlephobia.com/package/telegram-badge)
|
|
7
9
|
[](https://www.typescriptlang.org/)
|
|
8
10
|
[](https://opensource.org/licenses/MIT)
|
|
9
11
|
|
|
12
|
+
[](https://github.com/chatman-media/telegram-badge)
|
|
13
|
+
[](https://dev.to/chatman-media/show-your-telegram-group-member-count-in-github-readme-46pl)
|
|
14
|
+
[](https://x.com/chatman_media/status/1947399700795244694)
|
|
15
|
+
|
|
10
16
|
This project generates SVG badges with the current member count of your Telegram group. Perfect for displaying community activity in GitHub README files or on websites.
|
|
11
17
|
|
|
12
18
|
## 🚀 Demo
|
|
@@ -197,6 +203,24 @@ Build the project:
|
|
|
197
203
|
npm run build
|
|
198
204
|
```
|
|
199
205
|
|
|
206
|
+
## Subscribe
|
|
207
|
+
|
|
208
|
+
[](https://www.tiktok.com/@chatman.media)
|
|
209
|
+
[](https://www.twitch.tv/chatman1984)
|
|
210
|
+
[](https://www.youtube.com/@chatman-media)
|
|
211
|
+
[](https://t.me/alexanderkireyev)
|
|
212
|
+
[](https://x.com/chatman_media)
|
|
213
|
+
|
|
214
|
+
## Star History
|
|
215
|
+
|
|
216
|
+
<a href="https://www.star-history.com/#chatman-media/telegram-badge&Date">
|
|
217
|
+
<picture>
|
|
218
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=chatman-media/telegram-badge&type=Date&theme=dark" />
|
|
219
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=chatman-media/telegram-badge&type=Date" />
|
|
220
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=chatman-media/telegram-badge&type=Date" />
|
|
221
|
+
</picture>
|
|
222
|
+
</a>
|
|
223
|
+
|
|
200
224
|
## 🤝 Contributing
|
|
201
225
|
|
|
202
226
|
1. Fork the repository
|
package/README.ru.md
CHANGED
|
@@ -4,9 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/chatman-media/telegram-badge/actions)
|
|
6
6
|
[](https://badge.fury.io/js/telegram-badge)
|
|
7
|
+
[](https://www.npmjs.com/package/telegram-badge)
|
|
8
|
+
[](https://bundlephobia.com/package/telegram-badge)
|
|
7
9
|
[](https://www.typescriptlang.org/)
|
|
8
10
|
[](https://opensource.org/licenses/MIT)
|
|
9
11
|
|
|
12
|
+
[](https://github.com/chatman-media/telegram-badge)
|
|
13
|
+
[](https://dev.to/chatman-media/show-your-telegram-group-member-count-in-github-readme-46pl)
|
|
14
|
+
[](https://x.com/chatman_media/status/1947399700795244694)
|
|
15
|
+
|
|
10
16
|
Этот проект генерирует SVG-бейдж с текущим количеством участников вашей Telegram-группы. Идеально подходит для отображения активности сообщества в README на GitHub или на сайте.
|
|
11
17
|
|
|
12
18
|
## 🚀 Демо
|
|
@@ -153,8 +159,77 @@ https://telegram-badge.vercel.app/api/telegram-badge?logo=false
|
|
|
153
159
|
- 🆓 Бесплатно на Vercel при обычной нагрузке
|
|
154
160
|
- 📡 Можно расширить до отображения активности / количества сообщений
|
|
155
161
|
|
|
156
|
-
|
|
162
|
+
## 🔧 Использование API
|
|
163
|
+
|
|
164
|
+
### Как npm пакет:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
npm install telegram-badge
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
import badgeHandler from 'telegram-badge';
|
|
172
|
+
|
|
173
|
+
// Используйте в вашей serverless функции
|
|
174
|
+
export default badgeHandler;
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Прямые вызовы API:
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
GET /api/telegram-badge?style=flat&label=Участники&color=2AABEE&labelColor=555555
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## 🧪 Тестирование
|
|
184
|
+
|
|
185
|
+
Запустить тесты:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
npm test
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Проверка типов:
|
|
157
192
|
|
|
158
|
-
|
|
193
|
+
```bash
|
|
194
|
+
npm run type-check
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Сборка проекта:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
npm run build
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Подписывайтесь
|
|
204
|
+
|
|
205
|
+
[](https://www.tiktok.com/@chatman.media)
|
|
206
|
+
[](https://www.twitch.tv/chatman1984)
|
|
207
|
+
[](https://www.youtube.com/@chatman-media)
|
|
208
|
+
[](https://t.me/alexanderkireyev)
|
|
209
|
+
[](https://x.com/chatman_media)
|
|
210
|
+
|
|
211
|
+
## История звёзд
|
|
212
|
+
|
|
213
|
+
<a href="https://www.star-history.com/#chatman-media/telegram-badge&Date">
|
|
214
|
+
<picture>
|
|
215
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=chatman-media/telegram-badge&type=Date&theme=dark" />
|
|
216
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=chatman-media/telegram-badge&type=Date" />
|
|
217
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=chatman-media/telegram-badge&type=Date" />
|
|
218
|
+
</picture>
|
|
219
|
+
</a>
|
|
220
|
+
|
|
221
|
+
## 🤝 Внести вклад
|
|
222
|
+
|
|
223
|
+
1. Форкните репозиторий
|
|
224
|
+
2. Создайте ветку для новой функции (`git checkout -b feature/amazing-feature`)
|
|
225
|
+
3. Зафиксируйте изменения (`git commit -m 'Add some amazing feature'`)
|
|
226
|
+
4. Отправьте ветку (`git push origin feature/amazing-feature`)
|
|
227
|
+
5. Откройте Pull Request
|
|
228
|
+
|
|
229
|
+
## 📜 Лицензия
|
|
230
|
+
|
|
231
|
+
Этот проект лицензирован под лицензией MIT - подробности в файле [LICENSE](LICENSE).
|
|
232
|
+
|
|
233
|
+
---
|
|
159
234
|
|
|
160
|
-
|
|
235
|
+
Сделано с ❤️ от [Chatman Media](https://github.com/chatman-media)
|
package/README.zh.md
CHANGED
|
@@ -4,9 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/chatman-media/telegram-badge/actions)
|
|
6
6
|
[](https://badge.fury.io/js/telegram-badge)
|
|
7
|
+
[](https://www.npmjs.com/package/telegram-badge)
|
|
8
|
+
[](https://bundlephobia.com/package/telegram-badge)
|
|
7
9
|
[](https://www.typescriptlang.org/)
|
|
8
10
|
[](https://opensource.org/licenses/MIT)
|
|
9
11
|
|
|
12
|
+
[](https://github.com/chatman-media/telegram-badge)
|
|
13
|
+
[](https://dev.to/chatman-media/show-your-telegram-group-member-count-in-github-readme-46pl)
|
|
14
|
+
[](https://x.com/chatman_media/status/1947399700795244694)
|
|
15
|
+
|
|
10
16
|
本项目生成显示 Telegram 群组当前成员数量的 SVG 徽章。非常适合在 GitHub README 文件或网站上展示社区活跃度。
|
|
11
17
|
|
|
12
18
|
## 🚀 演示
|
|
@@ -197,6 +203,24 @@ npm run type-check
|
|
|
197
203
|
npm run build
|
|
198
204
|
```
|
|
199
205
|
|
|
206
|
+
## 订阅
|
|
207
|
+
|
|
208
|
+
[](https://www.tiktok.com/@chatman.media)
|
|
209
|
+
[](https://www.twitch.tv/chatman1984)
|
|
210
|
+
[](https://www.youtube.com/@chatman-media)
|
|
211
|
+
[](https://t.me/alexanderkireyev)
|
|
212
|
+
[](https://x.com/chatman_media)
|
|
213
|
+
|
|
214
|
+
## 星标历史
|
|
215
|
+
|
|
216
|
+
<a href="https://www.star-history.com/#chatman-media/telegram-badge&Date">
|
|
217
|
+
<picture>
|
|
218
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=chatman-media/telegram-badge&type=Date&theme=dark" />
|
|
219
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=chatman-media/telegram-badge&type=Date" />
|
|
220
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=chatman-media/telegram-badge&type=Date" />
|
|
221
|
+
</picture>
|
|
222
|
+
</a>
|
|
223
|
+
|
|
200
224
|
## 🤝 贡献
|
|
201
225
|
|
|
202
226
|
1. Fork 本仓库
|
|
@@ -26,7 +26,7 @@ function generateBadgeSVG(format) {
|
|
|
26
26
|
</g>
|
|
27
27
|
${logoForBadge}
|
|
28
28
|
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="100">
|
|
29
|
-
<text x="${(labelWidth / 2 + (logo ?
|
|
29
|
+
<text x="${(labelWidth / 2 + (logo ? 7 : 0)) * 10}" y="175" transform="scale(.1)" fill="#fff" textLength="${label.length * 65}">${label.toUpperCase()}</text>
|
|
30
30
|
<text x="${(labelWidth + messageWidth / 2) * 10}" y="175" font-weight="bold" transform="scale(.1)" fill="#fff" textLength="${message.length * 65}">${message.toUpperCase()}</text>
|
|
31
31
|
</g>
|
|
32
32
|
</svg>`;
|
|
@@ -41,7 +41,7 @@ function generateBadgeSVG(format) {
|
|
|
41
41
|
</g>
|
|
42
42
|
${logoElement}
|
|
43
43
|
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
|
|
44
|
-
<text x="${(labelWidth / 2 + (logo ?
|
|
44
|
+
<text x="${(labelWidth / 2 + (logo ? 7 : 0)) * 10}" y="140" transform="scale(.1)" fill="#fff" textLength="${label.length * 65}">${label}</text>
|
|
45
45
|
<text x="${(labelWidth + messageWidth / 2) * 10}" y="140" transform="scale(.1)" fill="#fff" textLength="${message.length * 65}">${message}</text>
|
|
46
46
|
</g>
|
|
47
47
|
</svg>`;
|
|
@@ -65,7 +65,7 @@ function generateBadgeSVG(format) {
|
|
|
65
65
|
</g>
|
|
66
66
|
${socialLogoElement}
|
|
67
67
|
<g fill="#333" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-weight="700" font-size="110">
|
|
68
|
-
<text x="${(labelWidth / 2 + 1 + (logo ?
|
|
68
|
+
<text x="${(labelWidth / 2 + 1 + (logo ? 7 : 0)) * 10}" y="140" transform="scale(.1)" fill="#fff" textLength="${label.length * 65}">${label}</text>
|
|
69
69
|
<text x="${(labelWidth + messageWidth / 2 + 2) * 10}" y="140" transform="scale(.1)" fill="#fff" textLength="${message.length * 65}">${message}</text>
|
|
70
70
|
</g>
|
|
71
71
|
</svg>`;
|
|
@@ -90,7 +90,7 @@ function generateBadgeSVG(format) {
|
|
|
90
90
|
</g>
|
|
91
91
|
${logoElement}
|
|
92
92
|
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
|
|
93
|
-
<text x="${(labelWidth / 2 + (logo ?
|
|
93
|
+
<text x="${(labelWidth / 2 + (logo ? 7 : 0)) * 10}" y="140" transform="scale(.1)" fill="#fff" textLength="${label.length * 65}">${label}</text>
|
|
94
94
|
<text x="${(labelWidth + messageWidth / 2) * 10}" y="140" transform="scale(.1)" fill="#fff" textLength="${message.length * 65}">${message}</text>
|
|
95
95
|
</g>
|
|
96
96
|
</svg>`;
|
|
@@ -112,8 +112,8 @@ function generateBadgeSVG(format) {
|
|
|
112
112
|
</g>
|
|
113
113
|
${logoElement}
|
|
114
114
|
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
|
|
115
|
-
<text aria-hidden="true" x="${(labelWidth / 2 + (logo ?
|
|
116
|
-
<text x="${(labelWidth / 2 + (logo ?
|
|
115
|
+
<text aria-hidden="true" x="${(labelWidth / 2 + (logo ? 7 : 0)) * 10}" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="${label.length * 65}">${label}</text>
|
|
116
|
+
<text x="${(labelWidth / 2 + (logo ? 7 : 0)) * 10}" y="140" transform="scale(.1)" fill="#fff" textLength="${label.length * 65}">${label}</text>
|
|
117
117
|
<text aria-hidden="true" x="${(labelWidth + messageWidth / 2) * 10}" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="${message.length * 65}">${message}</text>
|
|
118
118
|
<text x="${(labelWidth + messageWidth / 2) * 10}" y="140" transform="scale(.1)" fill="#fff" textLength="${message.length * 65}">${message}</text>
|
|
119
119
|
</g>
|