PHP code example of skrtdev / novagram

1. Go to this page and download the library: Download skrtdev/novagram library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

skrtdev / novagram example snippets


use skrtdev\NovaGram\Bot;
use skrtdev\Telegram\Message;

$Bot = new Bot('YOUR_TOKEN');

$Bot->onCommand('start', function (Message $message) {
    $message->reply('Hey! Nice to meet you. Use /info to know more about me.');
});

$Bot->onCommand('info', function (Message $message) {
    $message->reply('Well, I\'m just an example, but you can learn more about NovaGram at novagram.gaetano.eu.org');
});



if (!file_exists('novagram.phar')) {
    copy('https://gaetano.eu.org/novagram/phar.phar', 'novagram.phar');
}