https://github.com/iamshaynez/telegram-counter
https://github.com/iamshaynez/telegram-counter
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/iamshaynez/telegram-counter
- Owner: iamshaynez
- License: mit
- Created: 2023-09-19T22:55:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-28T13:39:23.000Z (almost 2 years ago)
- Last Synced: 2024-10-28T20:38:33.900Z (9 months ago)
- Language: JavaScript
- Size: 58.6 KB
- Stars: 11
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cloudflare - telegram-counter - Backend, geschrieben mit reinem Cloudflare Worker und D1-Datenbank, praktisch für das Aufzeichnen von Check-ins jederzeit und überall. | | Scheint nicht gewartet zu werden | (Sonstiges)
README
# telegram-counter
## How to start
### Clone the project to local
Or fork it...
### Prepare your secrets in .dev.vars
```
TG_BOT_TOKEN=
TG_CHAT_ID=
```
### wrangler environment- Init wrangler environment follow instructions on cloudflare
### Local D1 Database
- Follow the instructions to init the instance under your account
- Update information in wrangler.toml
- Init using the scripts under src/database (locally first)### Run in local environment
```
npx wrangler dev
```### Connect with your Telegram Bot
You may need ngrok to proxy the traffic back to your local environment
```
To set the webhook mannually. Register from worker will be implemented in later phases.https://api.telegram.org/bot{my_bot_token}/setWebhook?url={url_to_send_updates_to}
```## Deploy online
### Deploy D1 Database
```
npx wrangler d1 execute counter --file=./src/database/01_init.sql
```### Deploy service
```
npx wrangler deploy
```