GithubHelp home page GithubHelp logo

randyortonx / starter-telegram-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cyclic-software/starter-telegram-bot

0.0 0.0 0.0 11.75 MB

Cyclic starter telegram bot

License: MIT License

TypeScript 100.00%

starter-telegram-bot's Introduction

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

The Telegram Bot Starter.

Deployment

Prerequisites

Make sure that you have the following programs installed on your own local machine.

Step 1 โ€” Deploy on Cyclic ๐Ÿš€

Take your new Telegram bot live with one click.
Free hosting. No credit card required.

Deploy to Cyclic

Deploying an app to Cyclic

Step 2 โ€” Configure environment variables

  1. Grab your Telegram bot's API token by sending a message to @BotFather.

Send /newbot to @BotFather to create a new bot and get its API token.

  1. Add that API token to your Cyclic deployment's environment variables.

  1. 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

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

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. (see above)
  3. Create the file .env and add the following line:
TELEGRAM_TOKEN=... # YOUR TELEGRAM API TOKEN
  1. Download dependencies: yarn
  2. Start your bot: yarn dev

Usage Examples

Being greeted by the bot

Bot responding to the yo command with

Applying text effects

Bot applying various text effects such as monospace and italic to the text

Invoking the bot in other chats

Note This feature is also known as Inline Queries.

Bot applying the monospace text effect to the text

starter-telegram-bot's People

Contributors

youneslaa7878 avatar eludadev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.