Telegram API made for php (Simple usage)

Overview

Telegram

Telegram API made for php (Simple usage)

How to use?

  1. Download the project & place Telegram folder tp your project directory (For example i set mywebhook in https://Urmom.com/MyBot/Main.php and i should place Telegram folder into MyBot directory!)
  2. Now we need something like ths in our Main.php :

/* Important for define variable $bot */
use Telegram\Bot;
/* Important to require all classes */
spl_autoload_register(function ($class){require_once __DIR__ . '/' . str_replace('\\', '/', $class) . '.php';});
/* Definition of our bot class! REPLACE TOKEN WITH YOUR BOT TOKEN! */
$bot = new Bot("TOKEN");
  1. Now we need to check what message is ? I mean is message that sent by user a media or a text ? to do this we should use something like :
message()->send("Hope [you](tg://settings) *like* it!", null, true, false); } } ">
/**
 * With this method you can check if message sent by user is instance of Text
 * You can also try others like :
 * issetMedia() : To check if message is instance of Document/Audio/Photo/Video/Sticker/Gif
 * Or you can try them one by one : issetMessage() or issetDocument or issetAudio or issetVideo or issetPhoto
 */
if ($bot->issetMessage()) {
    /* Here is the message that user sent */
    $text = $bot->message()->text();
    /* If message is /start */
    if ($text === '/start') {
        /* Sending a message with some text formats */
        $bot->message()->send("```Hello```\n, _welcome to_ *UR BOT*!"/* I think now you now how to use text formats in telegram */);
        /**
         * Another message with another text formats
         * null value in below input is for chat_id, sometimes you want to send a message to another chats (Like your group/Channel/OtherBotUsers)!
         * true value in below input is for replying bot to the message that user sent (Default is false!)
         * false value in below input is for replying user to the message that bot sent (Force_reply, Default is false)
         */
        $bot->message()->send("Hope [you](tg://settings) *like* it!", null, true, false);
    }
}
  1. SetWebhook and make sure your host have activated ssl, Specially thanks for those who report bugs & problems in issues ;)
You might also like...
Easy to install email tracker with gui and telegram api bot with date device & ip tracking,

mail-php-tracking-with-gui 📧 Simple mail tracking program that uses php, html, telegram bot, and a gui The gui The gui lets you create specific links

A telegram bot to check credit cards. written in php & py

MRBANKER BOT A telegram bot to check credit cards. written in php & py. You can find me on telegram STEP1: goto botfather create a bot copy the token

NovaGram - An elegant, Object-Oriented, reliable PHP Telegram Bot Library
NovaGram - An elegant, Object-Oriented, reliable PHP Telegram Bot Library

An elegant, Object-Oriented, reliable PHP Telegram Bot Library Full Documentation • Public support group Examples • Features • Installation ?

TeleBot - Easy way to create Telegram-bots in PHP. Rich Laravel support out of the box.

TeleBot is a PHP library for telegram bots development. Rich Laravel support out of the box. Has an easy, clean, and extendable way to handle telegram Updates.

PHP Source - Telegram Bot - Standart Method

Telegram Bot- yaratish uchun mo'ljallangan standart metod asosida ishlovchi, PHP tilida yozilgan kod Dasturchilarning eng yaxshi ko'rgan odati c/p bo'

A Php Checker Bot For Telegram.
A Php Checker Bot For Telegram.

A Card Checker Bot For Telegram Based On Telegram.

Fluent Keyboard builder for php-telegram-bot.
Fluent Keyboard builder for php-telegram-bot.

Table of Contents Installation Usage Defining a Keyboard Defining Buttons Bind Buttons to a Keyboard By Row By Button As Stack ForceReply and ReplyKey

Create modern Telegram Bots with PHP.

Telepath Create Telegram Bots with this modern PHP library Explore the docs » Report Bug · Request Feature Table of Contents About The Project Before

A tool for sending fast and managed messages to Telegram bot users

👋🏻 HiToAll A tool for sending fast and managed messages to Telegram bot users About In some telegram bots programmed with php language, if there are

Owner
For supporting me, give start to repositories. Discord: HighestDreams#7683
null
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.

Telegram Bot API - PHP SDK Telegram Bot PHP SDK lets you develop Telegram Bots in PHP easily! Supports Laravel out of the box. Telegram Bot API is an

Irfaq Syed 2.5k Jan 6, 2023
PHP Telegram Bot based on the official Telegram Bot API

PHP Telegram Bot based on the official Telegram Bot API

null 4 Dec 8, 2021
Robot increase telegram post 👁‍🗨Telegram Fake Posts Viewer👁‍🗨

Program Features - ?? Very and stylish design. - ?? It has glass buttons. - ?? Has a professional management panel. - ?? Has a user area. - ?? Free di

hack4lx 4 Nov 25, 2022
Adds a specific header to every response to disable Google's usage of your site in it's FLoC tracking method.

Go Unfloc Yourself Description A bundle for Symfony 5 that adds a Permissions-Policy header in all the responses to prevent the use of new Google's "F

(infinite) loophp 3 Feb 25, 2022
HTTP Requestor: Package for a client request that supports you to make an external service request easily and with fast usage.

HttpRequestor from Patienceman HTTP Requestor: Package for a client request that supports you to make an external service request easily and with fast

Manirabona Patience 2 Aug 26, 2022
Integrate Your PHP Code With Telegram Bot API for Beginner

Documentation[https://core.telegram.org/bots/api] Resource[https://github.com/bachors/KBBI.sql] Integrate Your PHP Code With Telegram Bot API for Begi

Nova Andre Saputra 1 Oct 19, 2021
Simple telegram auto reminder BOT with PHP

Telebot Script Telegram BOT Auto Reminder Dibuat pake PHP OOP Sebenernya bukan buat dipublish sih, ini cuma buat praktek PHP OOP sama praktek Commit &

its Galih 4 Nov 7, 2022
Simple php telegram bot.

PHPTGBot Description Simple php telegram bot. Just for fun ?? Work In Progress ?? Maybe found error, since im not tested yet! Still on working, so be

Yoga Pranata 2 Nov 24, 2021
A simple php telegram bot to check if the bin is valid or not!

Bin-Checker A simple php telegram bot to check if the bin is valid or not! Deploy FORK the Repo by clicking HERE Add your bot token in LINE 12 THEN DE

ʀᴇxɪɴᴀᴢᴏʀ 1 Nov 23, 2021
SDK for latest version of Telegram bots API

SDK for latest version of Telegram bots API (from April 24, 2020) Using Examples Installing composer require "DiyorbekUz/Telelib: dev-master" Init bot

Diyorbek 2 Sep 5, 2021