Skip to content

Commit

Permalink
update npm readme
Browse files Browse the repository at this point in the history
  • Loading branch information
codebam committed May 12, 2024
1 parent 5015130 commit 3e17adb
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions packages/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@

serverless telegram bot on cf workers

The original `worker.js` is the content of Nikhil John's
https://github.com/nikhiljohn10/telegram-bot-worker which is licensed with MIT.
My modifications are licensed under the Apache license.
To get continuous conversation with AI working make sure you add a database
to your wrangler.toml and initailize it with the schema.sql

The first bot configuration is fully featured, and responds to all received
messages with llama2 if a command isn't found.
```sh
npm i @codebam/cf-workers-telegram-bot
```

To get continuous conversation with llama2 working make sure you add a database
to your wrangler.toml and initailize it with the schema.sql
See `worker.ts` and follow the instructions below.

---

To use the deploy button:

Expand Down Expand Up @@ -45,19 +46,4 @@ To fork this repo and use wrangler:

## Getting started with cf-workers-telegram-bot

Once you've deployed the bot you can get your Webhook command URL by doing any
of the following.

- sha256sum(SECRET_TELEGRAM_API_TOKEN) is the path to your webhook commands and
should be put at the end of your worker URL to access commands such as
setting your webhook
- Use `echo -n yoursecretkey | sha256sum` to get the path
- Open the Cloudflare Worker Logs under **Workers > cf-workers-telegram-bot
> Logs > Begin log stream** and make a GET request (open it in your browser)
to your Worker URL and look at the logs to see your Access URL
- Run `wrangler tail --format pretty` from inside your git repository and make
a GET request to your Worker URL

Example URL for setting the Webhook and dropping pending updates:

`https://cf-workers-telegram-bot.codebam.workers.dev/a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447?command=set`
Once you've deployed the bot you can get your Webhook command URL by calling `await bot.webhook.set()`

0 comments on commit 3e17adb

Please sign in to comment.