Download the PHP package alish/telegram without Composer

On this page you can find all versions of the php package alish/telegram. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package telegram

Laravel Telegram Bot

use this package for working with telegram api bot, this package develped to work well with laravel but with some minor change you can use this with raw php

INSTALLATION

Additional Setup for Laravel 5 to 5.4

you need to add service provider and facade manually to config/app.php

for laravel 5.5 and above you don't need do this

Config file

publish config file

then you see config file in config/telegram.php

config file is like below

Defaults

fill token_bot with token you get from bot father, and set webhook with your desire url (relative url)

Commands

if you want to handle commands receive from telegram api bot in specific class ypu can declare it here, first set 'active' to true, then in 'list' array list your command with related Class handlers. classes specified in this file should inheret from then put your logic in handler function Example

you have access to Message object with $this->message (See Message Class) NOTE *** if you active commands handler then you'll not get message in MessageHandler in your handlers section

Handlers

in this section we splited message type that receieve from telegram to seperate class handlers, then for handle each type you need to declare related class. class have been defined as handlers should inheret from TelegramUpdateHandler Example:

you have access to Update object with $this->update See Update Documentation

Loaders

if you want to do some actions before handle message you can define loader classes. this class receive update object recieve from telegram api class have been define as loaders should inheret from TelegramLoader Example:

this loaders don't prevent from your defioned handlers to receive update, then be careful to use these

Telegram Facade

with this facade you can do all actions defined in telegram api bot (See Available Methods)[https://core.telegram.org/bots/api#available-methods]

How to use this

you only need to use same methods in telegram api Example:

because chat_id is require for all action except 1 or 2, you can use

sending buttons

for sending buttons you need to json_encode button arrays Example

sending files

for sending files you need use getFile method from InputFile class Example:

getUser

you can get telegram user in recevied update with below command: to see which information is in user object see (User Object)[https://core.telegram.org/bots/api#user]

How this package works

all telegram object mapped to their classes, this means when an update receive from telegram api it maps to Update class, Update Class Contains:

you can't access directly to this properties because this should initiate from what receivedd from telegram api, if you want to access to each property use dynamic method with 'get' prefix for example for getting update_id use getUpdateId() method if you want manipulate received message use set method to change properties, $update->setUpdateId('whatever');


All versions of telegram with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
illuminate/routing Version ~5.0
illuminate/database Version ~5.0
illuminate/support Version ~5.0
illuminate/http Version ~5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alish/telegram contains the following files

Loading the files please wait ....