Download the PHP package radyakaze/phptelebot without Composer

On this page you can find all versions of the php package radyakaze/phptelebot. 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 phptelebot

PHPTelebot

Telegram bot framework written in PHP

Features

Requirements

Installation

Using Composer

To install PHPTelebot with Composer, just add the following to your composer.json file:

or by running the following command:

Composer installs autoloader at ./vendor/autoloader.php. to include the library in your script, add:

Install from source

Download the PHP library from Github, then include PHPTelebot.php in your script:

Usage

Creating a simple bot

Then run

You can also see my other sample.

NOTE:

Commands

Use $bot->cmd(<command>, <function>) to handle command.

Use * to catch any command.

File upload

This code will send a photo to users when type command /upload.

Events

Use $bot->on(<event>, <function>) to handle all possible PHPTelebot events.

To handle inline message, just add:

Also, you can catch multiple events:

Supported events:

Command with custom regex (advanced)

Create a command: /regex string number

Methods

PHPTelebot Methods

cmd(<command>, <answer>)

Handle a command.

on(<event>, <answer>)

Handles events.

regex(<regex>, <answer>)

Create custom regex for command.

Bot::type()

Return message event type.

Bot::message()

Get message properties.

Telegram Methods

PHPTelebot use standard Telegram Bot API method names.

Bot::getMe() ?

A simple method for testing your bot's auth token.

Bot::sendMessage(<text>, <options>) ?

Use this method to send text messages.

Bot::forwardMessage(<options>) ?

Use this method to forward messages of any kind.

Bot::sendPhoto(<file path | file id | url>, <options>) ?

Use this method to send a photo.

Bot::sendVideo(<file path | file id | url>, <options>) ?

Use this method to send a video.

Bot::sendAudio(<file path | file id | url>, <options>) ?

Use this method to send a audio.

Bot::sendVoice(<file path | file id | url>, <options>) ?

Use this method to send a voice message.

Bot::sendDocument(<file path | file id | url>, <options>) ?

Use this method to send a document.

Bot::sendSticker(<file path | file id | url>, <options>) ?

Use this method to send a sticker.

Bot::sendLocation(<options>) ?

Use this method to send point on the map.

Bot::sendVenue(<options>) ?

Use this method to send information about a venue.

Bot::sendContact(<options>) ?

Use this method to send phone contacts.

Bot::sendChatAction(<action>, <options>) ?

Use this method when you need to tell the user that something is happening on the bot's side.

Bot::getUserProfilePhotos(<user id>, <options>) ?

Use this method to get a list of profile pictures for a user.

Bot::getFile(<file id>) ?

Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size.

Bot::answerInlineQuery(<array of results>, <options>) ?

Use this method to send answers to an inline query.

Bot::answerCallbackQuery(<text>, <options>) ?

Use this method to send answers to callback queries sent from inline keyboards.

Bot::getChat(<chat_id>) ?

Use this method to get up to date information about the chat.

Bot::leaveChat(<chat_id>) ?

Use this method for your bot to leave a group, supergroup or channel.

Bot::getChatAdministrators(<chat_id>) ?

Use this method to get a list of administrators in a chat.

Bot::getChatMembersCount(<chat_id>) ?

Use this method to get the number of members in a chat.

Bot::getChatMember(<options>) ?

Use this method to get information about a member of a chat.

Bot::kickChatMember(<options>) ?

Use this method to kick a user from a group or a supergroup.

Bot::unbanChatMember(<options>) ?

Use this method to unban a previously kicked user in a supergroup.

Bot::editMessageText(<options>) ?

Use this method to edit text messages sent by the bot or via the bot (for inline bots).

Bot::editMessageCaption(<options>) ?

Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).

Bot::editMessageReplyMarkup(<options>) ?

Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).

Bot::sendGame(<game short name>, <options>) ?

Use this method to send a game.

Bot::setGameScore(<options>) ?

Use this method to set the score of the specified user in a game.

Bot::getGameHighScores(<user id>, <options>) ?

Use this method to get data for high score tables.

Webhook installation

Open via browser https://api.telegram.org/bot<BOT TOKEN>/setWebhook?url=https://yourdomain.com/your_bot.php


All versions of phptelebot with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
ext-curl Version *
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 radyakaze/phptelebot contains the following files

Loading the files please wait ....