Giter Site home page Giter Site logo

annihilatorrrr / telegram-bot-php-bootstrap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mirrdhyn/telegram-bot-php-bootstrap

0.0 0.0 0.0 12 KB

This code written in PHP covers all features (almost) of Telegram Bot API

Home Page: https://core.telegram.org/bots/api

PHP 100.00%

telegram-bot-php-bootstrap's Introduction

Telegram-Bot-PHP-Bootstrat

This code, written in PHP, covers all features (almost) of Telegram Bot API

What's needed

Frontend accessible from Internet with PHP engine (5 or 7) and a SSL certificate, from Let's Encrypt, for instance. You can use this docker image to use your code and add a Nginx front to reverse proxy your bot. In fact, you can use your infrastructure where you are comfortable for, as long as you can get a JSON from HTTP POST request and send it back an answer in the same format.

How to get Hello from your bot?

  • Get a Bot token from https://t.me/BotFather with the command /newbot Declare your webhook link by typing the following link in your favorite browser :
  • Replace BOTTOKEN with the token previously created
  • Replace MYLINK with your FQDN (eg. my.bot.com) https://api.telegram.org/botBOTTOKEN/setWebhook?url=https://MYLINK/my_bot.php
  • Add the bot token in the b0tacc3s_guard.php file
  • Add your Telegram ID to the environment variable CHAT_ROOT in this file too. To get it, just uncomment the debug line 8 in my_bot.php and read the JSON stored in debug folder.

To go futher

You can custom your webhook setting from Telegram by adding some parameters : go here

You can deep-link the /start command. When you are authenticating your user from an OAuth provider, you can add your session token in your link. Eg. https://t.me/my_bot?start=1234token567890

Now, you are ready to modify this base code and add a lot of yours.

telegram-bot-php-bootstrap's People

Contributors

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