Amat Palermo Telegram Bot
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
src/GP/AmatPABot
LICENSE
README.md
composer.json
getUpdates.php

README.md

AMAT PAlermo Telegram BOT

NOT FOR PRODUCTION

Installation

Clone the github repo in your machine

$ git clone https://github.com/gpirrotta/amat-pa-bot.git
$ cd amat-pa-bot

And run these two commands to install it:

$ wget http://getcomposer.org/composer.phar
$ php composer.phar install

Now you can add the autoloader, and you will have access to the library:

<?php

require 'vendor/autoload.php';

You're done.

Usage

Set and rename the amat-config-blank.php file you find in the config directory.

<?php


    use GP\AmatPABot\AmatPABot;

    $config = require __DIR__ . '/config/amat-config.php';


    $token = $config['token'];
    $dbDriver = $config['connection'][$config['source']];
    $connectionString = str_replace(['[DRIVER]', '[HOST]', '[PORT]', '[DATABASE]'], [$dbDriver['driver'], $dbDriver['host'], $dbDriver['port'], $dbDriver['database']], $dbDriver['PDOString']);
    $username = $dbDriver['username'];
    $password = $dbDriver['password'];

    $amatPABot = new AmatPABot($token, $connectionString, $username, $password);

    // If you use WebHook invoke the following method
    $amatPABot->withWebHook();

    $amatPABot->run();

Requirements

  • = PHP 5.5

Detail

Demo

TODO

  • Add Tests :-( Sorry, I know they must be written before the code, TDD dixit

Credits

License

amat-pa-bot package is released under the MIT License. See the bundled LICENSE file for details.