Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/youneslaaroussi/telegram-bot
Telegram Bot that greets people, powered by Cyclic. ⚡️
https://github.com/youneslaaroussi/telegram-bot
bot bots chat chatbot serverless social-media telegram telegram-bot text-effects unicode
Last synced: about 22 hours ago
JSON representation
Telegram Bot that greets people, powered by Cyclic. ⚡️
- Host: GitHub
- URL: https://github.com/youneslaaroussi/telegram-bot
- Owner: youneslaaroussi
- License: mit
- Created: 2022-10-28T09:40:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-28T14:14:02.000Z (almost 2 years ago)
- Last Synced: 2025-01-05T23:28:12.778Z (4 days ago)
- Topics: bot, bots, chat, chatbot, serverless, social-media, telegram, telegram-bot, text-effects, unicode
- Language: TypeScript
- Homepage: https://t.me/CyclicDemoBot
- Size: 3.95 MB
- Stars: 22
- Watchers: 2
- Forks: 268
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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! [\@CyclicDemoBot](http://t.me/CyclicDemoBot)
## 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.
3. Set the `NODE_ENV` environment variable to `production`.
### 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 URLcurl "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).