diff --git a/README.md b/README.md new file mode 100644 index 00000000..a5723b61 --- /dev/null +++ b/README.md @@ -0,0 +1,90 @@ +# Telegram Bot, built on Cyclic 🤖 + +Say hello to the Telegram Bot template! Built on the [grammY](https://grammy.dev/) framework and hosted by the [Cyclic](https://www.cyclic.sh/) serverless platform. + +- Handling Inline Queries. +- Responding to commands. +- Interactive Inline Keyboards. + +Try it out now! [\@EludaSmarterBot](https://t.me/EludaSmarterBot) + +
+ + +## Deployment + +### Prerequisites + +Make sure that you have the following programs installed on your own local machine. + +- [Telegram Client](https://desktop.telegram.org/). +- cURL. + +### Step 1 — Deploy on Cyclic 🚀 + +Take your new Telegram bot live with one click. \ +**Free hosting. No credit card required.** + +[![Deploy to Cyclic](https://deploy.cyclic.sh/button.svg)](https://deploy.cyclic.sh/eludadev/telegram-bot) + + + +### Step 2 — Configure environment variables + +1. Grab your Telegram bot's API token by sending a message to [\@BotFather](https://telegram.me/BotFather). + + +2. Add that API token to your Cyclic deployment's environment variables. + + + +### Step 3 — Link the bot with your new server + +Connect your Telegram bot to your server by sending the following HTTP request using your terminal: + +#### Linux / MacOS + +```bash +export TELEGRAM_API_TOKEN=... # YOUR TELEGRAM API TOKEN +export TELEGRAM_WEBHOOK_URL=... # YOUR CYCLIC DEPLOYMENT URL + +curl "https://api.telegram.org/bot$TELEGRAM_API_TOKEN/setWebhook?url=$TELEGRAM_WEBHOOK_URL" +``` + +## How to run it locally? + +### Prerequisites + +- Node. +- Yarn. +- [Telegram Client](https://desktop.telegram.org/). + +### Local installation + +1. Clone the repository to your machine: `git clone https://github.com/eludadev/telegram-bot && cd telegram-bot` +2. Grab your bot's API token by messaging [\@BotFather](https://telegram.me/BotFather). (see above) +3. Create the file `.env` and add the following line: +```bash +TELEGRAM_TOKEN=... # YOUR TELEGRAM API TOKEN +``` +4. Download dependencies: `yarn` +5. Start your bot: `yarn dev` + +## Usage Examples + +### Being greeted by the bot + + + + +### Applying text effects + + + + +### Invoking the bot in other chats + +> **Note** +> This feature is also known as [Inline Queries](https://core.telegram.org/api/bots/inline). + + diff --git a/assets/bot-greeting.gif b/assets/bot-greeting.gif new file mode 100644 index 00000000..d12ae60f Binary files /dev/null and b/assets/bot-greeting.gif differ diff --git a/assets/bot-inline-queries.gif b/assets/bot-inline-queries.gif new file mode 100644 index 00000000..5e1e1a03 Binary files /dev/null and b/assets/bot-inline-queries.gif differ diff --git a/assets/bot-text-effects.gif b/assets/bot-text-effects.gif new file mode 100644 index 00000000..168603df Binary files /dev/null and b/assets/bot-text-effects.gif differ diff --git a/assets/creating-telegram-bot-api-token.gif b/assets/creating-telegram-bot-api-token.gif new file mode 100644 index 00000000..709cedf3 Binary files /dev/null and b/assets/creating-telegram-bot-api-token.gif differ diff --git a/assets/deploying-to-cyclic.gif b/assets/deploying-to-cyclic.gif new file mode 100644 index 00000000..f18f1fde Binary files /dev/null and b/assets/deploying-to-cyclic.gif differ diff --git a/assets/setting-api-token-in-cyclic.gif b/assets/setting-api-token-in-cyclic.gif new file mode 100644 index 00000000..936a0520 Binary files /dev/null and b/assets/setting-api-token-in-cyclic.gif differ diff --git a/assets/telegram-bot-banner.png b/assets/telegram-bot-banner.png new file mode 100644 index 00000000..1a21fb6c Binary files /dev/null and b/assets/telegram-bot-banner.png differ