Deploy remaining bots and fix schema validation (#927)

This commit is contained in:
Sidharth Mohanty
2023-11-10 00:14:47 +05:30
committed by GitHub
parent 0d568c758b
commit 14712cac88
13 changed files with 110 additions and 26 deletions

View File

@@ -1,21 +1,46 @@
---
title: '📱 Telegram Bot'
title: "📱 Telegram Bot"
---
### 🖼️ Template Setup
- Fork [this](https://replit.com/@taranjeetio/EC-Telegram-Bot-Template?v=1#README.md) replit template.
- Set your `OPENAI_API_KEY` in Secrets.
- Open the Telegram app and search for the `BotFather` user.
- Start a chat with BotFather and use the `/newbot` command to create a new bot.
- Follow the instructions to choose a name and username for your bot.
- Once the bot is created, BotFather will provide you with a unique token for your bot.
- Set this token as `TELEGRAM_BOT_TOKEN` in Secrets.
<Tabs>
<Tab title="docker">
```bash
docker run --name telegram-bot -e OPENAI_API_KEY=sk-xxx -e TELEGRAM_BOT_TOKEN=xxx -p 8000:8000 embedchain/telegram-bot
```
<Note>
If you wish to use **Docker**, you would need to host your bot on a server.
You can use [ngrok](https://ngrok.com/) to expose your localhost to the
internet and then set the webhook using the ngrok URL.
</Note>
</Tab>
<Tab title="replit">
<Card>
Fork <ins>**[this](https://replit.com/@taranjeetio/EC-Telegram-Bot-Template?v=1#README.md)**</ins> replit template.
</Card>
- Set your `OPENAI_API_KEY` in Secrets.
- Set the unique token as `TELEGRAM_BOT_TOKEN` in Secrets.
</Tab>
</Tabs>
- Click on `Run` in the replit container and a URL will get generated for your bot.
- Now set your webhook by running the following link in your browser:
```url
https://api.telegram.org/bot<Your_Telegram_Bot_Token>/setWebhook?url=<Replit_Generated_URL>
```
- When you get a successful response in your browser, your bot is ready to be used.
### 🚀 Usage Instructions

View File

@@ -12,10 +12,19 @@ pip install --upgrade embedchain
2. Launch your WhatsApp bot:
<Tabs>
<Tab title="docker">
```bash
docker run --name whatsapp-bot -e OPENAI_API_KEY=sk-xxx -p 8000:8000 embedchain/whatsapp-bot
```
</Tab>
<Tab title="python">
```bash
python -m embedchain.bots.whatsapp --port 5000
```
</Tab>
</Tabs>
```bash
python -m embedchain.bots.whatsapp --port 5000
```
If your bot needs to be accessible online, use your machine's public IP or DNS. Otherwise, employ a proxy server like [ngrok](https://ngrok.com/) to make your local bot accessible.