Skip to content

Composer require Troubleshooting

Marco Boretto edited this page Sep 23, 2015 · 1 revision

Composer require Troubleshooting

Install the bot from you git repository

Fork the project, and replace mboretto/php-telegram-bot with yourname/php-telegram-bot in ALL the following instructions:

Add to composer.json :

    "repositories": [
        {
            "type":"package",
            "package": {
              "name": "mboretto/php-telegram-bot",
              "version":"master",
              "source": {
                  "url": "https://github.com/mboretto/php-telegram-bot.git",
                  "type": "git",
                  "reference":"master"
                }
            }
        }
    ]

Add under "require" in composer.json :

"mboretto/php-telegram-bot": "*@dev" 

then run: (only update a specific package)

composer update mboretto/php-telegram-bot

Add the namespace fot the bot class under "autoload" "psr-4" in composer.json:

"autoload": {
        "psr-4": {
                "Longman\\TelegramBot\\": "vendor/mboretto/php-telegram-bot/src"
        }
    }

then run:

composer dump-autoload

Without require

git clone https://github.com/akalongman/php-telegram-bot.git
cd php-telegram-bot/
composer dump-autoload

then edit the set.php and hook.php as described in the README.md