Download the PHP package intrd/telegram-simple_phpbot without Composer

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

Telegram Simple PHP Bot - A different and simple approach to use Telegram Bot Plataform (No SSL or setWebhook needed)

Package intrd/telegram-simple_phpbot
Version 1.1
Tags telegram, bot, eggdrop, php
Project URL http://github.com/intrd/telegram-simple_phpbot
Author intrd (Danilo Salles) - http://dann.com.br
Copyright (CC-BY-SA-4.0) 2016, intrd
License Creative Commons Attribution-ShareAlike 4.0
Dependencies • php >=5.3.0 • intrd/php-common >=1.0.x-dev

Installation

System requiriments & dependencies

Usage

TL;DR: The sample.php file will check every 5s if someone is mentioning the bot @username or talking him in pvt. It process and reply based on his message w/ some custom triggers.

Steps to setup your bot

  1. Open Telegram, talk w/ the http://telegram.me/BotFather, setup a new Telegram Bot and take a note of your BotID:Botkey, something like: 234015785:AAEsvIjg0AcWOINXR0Xt-TGLamuz9k8f10Y
  2. Create a copy of configuration file sample cp config.ini.sample config.ini
  3. Edit config.ini and set your botkey
  4. Search on Telegram for your @username_bot and start a conversation..
  5. Now run php sample.php, it shows your chatID. Set debug_chatid on config.ini. All bot activity will be forwarded to this conversation, for debbugin purpose.
  6. Change the trigger to your username_bot or something you want to trigger your bot replies on groups.
  7. To check if someone is talking w/ your bot every 5 seconds use my bash daemon sample ./run.sh &, or watch -n5 php sample.php or setup a cronjob
  8. Now put him on a group..
  9. Test if your bot is replying when you mention his trigger, ask him about day of week, say him some of $bads, customize reply_get() function.

Tips

Manually check (botid/botkey/chatid)

Browse to your bot URL: https://api.telegram.org/bot<botid>:<botkey>/sendmessage?chat_id=<chatid>&text=hello%20world! in my sample https://api.telegram.org/bot234015785:AAEsvIjg0AcWOINXR0Xt-TGLamuz9k8f10Y/sendmessage?chat_id=65628842&text=hello%20world!, if the bot says Hello World! to you, its ok. PS: group chats use negative chatIDs, -<chatid>

If you prefer not to use daemons (SSL Webserver) With a SSL webserver serving your sample.php, simply setup your hook URL by browsing:
https://api.telegram.org/bot<botid>:<botkey>/setWebhook?url=http://yourwebserver/sample.php
..and Telegram server will load this URL every time the bot receive a msg.

That's all,
Script this 4 your needs and respect the CC license, thanks!


All versions of telegram-simple_phpbot with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
intrd/php-common Version 1.0.*-dev
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 intrd/telegram-simple_phpbot contains the following files

Loading the files please wait ....