Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iamshaynez/telegram-counter
https://github.com/iamshaynez/telegram-counter
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/iamshaynez/telegram-counter
- Owner: iamshaynez
- License: mit
- Created: 2023-09-19T22:55:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-28T13:39:23.000Z (about 1 year ago)
- Last Synced: 2024-08-01T08:08:29.263Z (4 months ago)
- Language: JavaScript
- Size: 58.6 KB
- Stars: 10
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cloudflare - telegram-counter
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
```