🤖
Telegram Bot, built on Cyclic Say hello to the Telegram Bot template! Built on the grammY framework and hosted by the Cyclic serverless platform.
- Handling Inline Queries.
- Responding to commands.
- Interactive Inline Keyboards.
Try it out now! @CyclicDemoBot
Deployment
Prerequisites
Make sure that you have the following programs installed on your own local machine.
- Telegram Client.
- cURL.
🚀
Step 1 — Deploy on Cyclic Take your new Telegram bot live with one click.
Free hosting. No credit card required.
Step 2 — Configure environment variables
- Grab your Telegram bot's API token by sending a message to @BotFather.
- Add that API token to your Cyclic deployment's environment variables.
- Set the
NODE_ENV
environment variable toproduction
.
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
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.
Local installation
- Clone the repository to your machine:
git clone https://github.com/eludadev/telegram-bot && cd telegram-bot
- Grab your bot's API token by messaging @BotFather. (see above)
- Create the file
.env
and add the following line:
TELEGRAM_TOKEN=... # YOUR TELEGRAM API TOKEN
- Download dependencies:
yarn
- 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.