NovaGram - An elegant, Object-Oriented, reliable PHP Telegram Bot Library

Overview



NovaGram

GitHub license GitHub stars Version Total Downloads Total Downloads

An elegant, Object-Oriented, reliable PHP Telegram Bot Library

Full DocumentationPublic support group
ExamplesFeaturesInstallation

🌟 v1.9 has been released: check changelog here

⚙️ Examples

An example code of a simple bot.
Works with both getUpdates and Webhooks

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 docs.novagram.ga');
});

📎 Features

  • Full: All the Methods and Types implemented in Bot Api 5.0 (support local Bot Api too)
  • Fast: Support for JSON payload, and async handling of updates
  • Extendable: With Prototypes, you can add your custom functionalities
  • Easy: Exactly like original Bot Api, with many methods simplified in a very nice way
  • Ready: You can start creating your amazing bot right now, thanks to many Built-in features, such as Conversations, Entities Parser and getDC
  • Secure: When using Webhooks, there is a Built-in Telegram IP Check, that works with Cloudflare too!

Why another PHP library?

I decided to build my own php library for telegram bot api because all the libraries i found on the web made it difficult even to do the simplest things, such as a sendMessage.
NovaGram is built in order to bring a lightweight alternative to make bots, so that it is simple for beginners, but powerful for who already knows how to implement it.

⬇️ Installation

Installation via Composer

Install NovaGram via Composer

composer require skrtdev/novagram ^1.9

After Installation, include NovaGram with:

require 'vendor/autoload.php';

Installation via Phar

Include the phar file in your bot file:

if (!file_exists('novagram.phar')) {
    copy('https://novagram.ga/phar', 'novagram.phar');
}
require_once 'novagram.phar';

More info in the Documentation

Comments
  • [BUG] ...

    [BUG] ...

    when use code in https://php-download.com/package/skrtdev/novagram/file/examples/inline_keyboard.php for inline_keyboard dont work and get some errors:

    https://php-download.com/package/skrtdev/novagram/file/examples/inline_keyboard.php

    [17-Aug-2021 15:41:09 UTC] [2021-08-17T15:41:09.107956+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:41:09 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:41:09 UTC] [2021-08-17T15:41:09.126017+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:41:09 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:41:11 UTC] [2021-08-17T15:41:11.141791+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:41:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:41:15 UTC] [2021-08-17T15:41:15.162884+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:41:15 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:41:23 UTC] [2021-08-17T15:41:23.180468+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:41:23 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:41:39 UTC] [2021-08-17T15:41:39.206354+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:41:39 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:42:11 UTC] [2021-08-17T15:42:11.227988+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:42:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:43:11 UTC] [2021-08-17T15:43:11.254602+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:43:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:44:11 UTC] [2021-08-17T15:44:11.290434+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:44:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:45:11 UTC] [2021-08-17T15:45:11.486068+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:45:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:46:11 UTC] [2021-08-17T15:46:11.552991+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:46:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:47:11 UTC] [2021-08-17T15:47:11.580028+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:47:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:48:11 UTC] [2021-08-17T15:48:11.608953+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:48:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:49:11 UTC] [2021-08-17T15:49:11.637823+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:49:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:50:11 UTC] [2021-08-17T15:50:11.802932+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:50:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:51:11 UTC] [2021-08-17T15:51:11.834456+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:51:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:52:11 UTC] [2021-08-17T15:52:11.881324+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:52:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19 [17-Aug-2021 15:53:11 UTC] [2021-08-17T15:53:11.916809+00:00] NovaGram.WARNING: Error handler is not set. Check docs at https://docs.novagram.ga/errors_handling.html [] [] [17-Aug-2021 15:53:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function button() in /..../examples/userbot.php:19 Stack trace: #0 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(126): {closure}(Object(skrtdev\Telegram\Message), Array) #1 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(111): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message), Array) #2 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/HandlersTrait.php(90): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #3 phar:///..../examples/novagram.phar/skrtdev/novagram/src/NovaGram/Dispatcher.php(61): skrtdev\NovaGram\Bot->skrtdev\NovaGram{closure}(Object(skrtdev\Telegram\Message)) #4 phar:///..../examples/novagram.ph in /..../examples/userbot.php on line 19

    and $Bot->onCallbackQuery(fn(CallbackQuery $callback_query) => $callback_query->answer()); // answer all the callback queries
    has syntax error in attached file Untitled

    bug 
    opened by NZ62AN 17
  • [BUG] ...unable to install

    [BUG] ...unable to install

    Describe the bug Do not run Composer as root/super user! See https://getcomposer.org/root for details Warning from https://packagist.org: You are using an outdated version of Composer. Composer 2.0 is now available and you should upgrade. See https://getcomposer.org/2 Using version ^1.2 for skrtdev/novagram ./composer.json has been updated Root package 'skrtdev/novagram' cannot require itself in its composer.json Did you accidentally name your root package after an external package?

    To Reproduce composer require skrtdev/novagram

    Expected behavior for the installer to work

    Full Traceback [email protected] /var/www/html # git clone https://github.com/skrtdev/NovaGram.git Cloning into 'NovaGram'... remote: Enumerating objects: 468, done. remote: Counting objects: 100% (468/468), done. remote: Compressing objects: 100% (330/330), done. remote: Total 2039 (delta 229), reused 338 (delta 135), pack-reused 1571 Receiving objects: 100% (2039/2039), 417.34 KiB | 1.40 MiB/s, done. Resolving deltas: 100% (1269/1269), done. [email protected] /var/www/html # mv NovaGram/ novagram [email protected] /var/www/html # cd novagram [email protected] /var/www/html/novagram # apt install composer Reading package lists... Done Building dependency tree
    Reading state information... Done The following package was automatically installed and is no longer required: grub-pc-bin Use 'apt autoremove' to remove it. The following additional packages will be installed: jsonlint php-cli-prompt php-composer-ca-bundle php-composer-semver php-composer-spdx-licenses php-json-schema php-psr-log php-symfony-console php-symfony-debug php-symfony-filesystem php-symfony-finder php-symfony-polyfill-mbstring php-symfony-process Suggested packages: fossil mercurial subversion php-zip php-symfony-event-dispatcher php-symfony-lock php-mbstring The following NEW packages will be installed: composer jsonlint php-cli-prompt php-composer-ca-bundle php-composer-semver php-composer-spdx-licenses php-json-schema php-psr-log php-symfony-console php-symfony-debug php-symfony-filesystem php-symfony-finder php-symfony-polyfill-mbstring php-symfony-process 0 upgraded, 14 newly installed, 0 to remove and 59 not upgraded. Need to get 586 kB of archives. After this operation, 3482 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-json-schema all 5.2.6-1 [32.5 kB] Get:2 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-composer-ca-bundle all 1.1.0-1 [13.7 kB] Get:3 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-composer-semver all 1.4.2-1 [10.6 kB] Get:4 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-composer-spdx-licenses all 1.3.0-1 [10.4 kB] Get:5 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 jsonlint all 1.7.1-1 [11.2 kB] Get:6 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-symfony-polyfill-mbstring all 1.6.0-2 [12.1 kB] Get:7 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-psr-log all 1.0.2-1 [6976 B] Get:8 http://mirrors.digitalocean.com/ubuntu bionic-updates/universe amd64 php-symfony-debug all 3.4.6+dfsg-1ubuntu0.1 [36.4 kB] Get:9 http://mirrors.digitalocean.com/ubuntu bionic-updates/universe amd64 php-symfony-console all 3.4.6+dfsg-1ubuntu0.1 [65.6 kB] Get:10 http://mirrors.digitalocean.com/ubuntu bionic-updates/universe amd64 php-symfony-finder all 3.4.6+dfsg-1ubuntu0.1 [21.9 kB] Get:11 http://mirrors.digitalocean.com/ubuntu bionic-updates/universe amd64 php-symfony-process all 3.4.6+dfsg-1ubuntu0.1 [28.8 kB] Get:12 http://mirrors.digitalocean.com/ubuntu bionic-updates/universe amd64 php-symfony-filesystem all 3.4.6+dfsg-1ubuntu0.1 [18.7 kB] Get:13 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 php-cli-prompt all 1.0.3+dfsg-1 [4620 B] Get:14 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 composer all 1.6.3-1 [313 kB] Fetched 586 kB in 1s (1120 kB/s) Selecting previously unselected package php-json-schema. (Reading database ... 61558 files and directories currently installed.) Preparing to unpack .../00-php-json-schema_5.2.6-1_all.deb ... Unpacking php-json-schema (5.2.6-1) ... Selecting previously unselected package php-composer-ca-bundle. Preparing to unpack .../01-php-composer-ca-bundle_1.1.0-1_all.deb ... Unpacking php-composer-ca-bundle (1.1.0-1) ... Selecting previously unselected package php-composer-semver. Preparing to unpack .../02-php-composer-semver_1.4.2-1_all.deb ... Unpacking php-composer-semver (1.4.2-1) ... Selecting previously unselected package php-composer-spdx-licenses. Preparing to unpack .../03-php-composer-spdx-licenses_1.3.0-1_all.deb ... Unpacking php-composer-spdx-licenses (1.3.0-1) ... Selecting previously unselected package jsonlint. Preparing to unpack .../04-jsonlint_1.7.1-1_all.deb ... Unpacking jsonlint (1.7.1-1) ... Selecting previously unselected package php-symfony-polyfill-mbstring. Preparing to unpack .../05-php-symfony-polyfill-mbstring_1.6.0-2_all.deb ... Unpacking php-symfony-polyfill-mbstring (1.6.0-2) ... Selecting previously unselected package php-psr-log. Preparing to unpack .../06-php-psr-log_1.0.2-1_all.deb ... Unpacking php-psr-log (1.0.2-1) ... Selecting previously unselected package php-symfony-debug. Preparing to unpack .../07-php-symfony-debug_3.4.6+dfsg-1ubuntu0.1_all.deb ... Unpacking php-symfony-debug (3.4.6+dfsg-1ubuntu0.1) ... Selecting previously unselected package php-symfony-console. Preparing to unpack .../08-php-symfony-console_3.4.6+dfsg-1ubuntu0.1_all.deb ... Unpacking php-symfony-console (3.4.6+dfsg-1ubuntu0.1) ... Selecting previously unselected package php-symfony-finder. Preparing to unpack .../09-php-symfony-finder_3.4.6+dfsg-1ubuntu0.1_all.deb ... Unpacking php-symfony-finder (3.4.6+dfsg-1ubuntu0.1) ... Selecting previously unselected package php-symfony-process. Preparing to unpack .../10-php-symfony-process_3.4.6+dfsg-1ubuntu0.1_all.deb ... Unpacking php-symfony-process (3.4.6+dfsg-1ubuntu0.1) ... Selecting previously unselected package php-symfony-filesystem. Preparing to unpack .../11-php-symfony-filesystem_3.4.6+dfsg-1ubuntu0.1_all.deb ... Unpacking php-symfony-filesystem (3.4.6+dfsg-1ubuntu0.1) ... Selecting previously unselected package php-cli-prompt. Preparing to unpack .../12-php-cli-prompt_1.0.3+dfsg-1_all.deb ... Unpacking php-cli-prompt (1.0.3+dfsg-1) ... Selecting previously unselected package composer. Preparing to unpack .../13-composer_1.6.3-1_all.deb ... Unpacking composer (1.6.3-1) ... Setting up php-psr-log (1.0.2-1) ... Setting up php-symfony-finder (3.4.6+dfsg-1ubuntu0.1) ... Setting up php-composer-ca-bundle (1.1.0-1) ... Setting up php-json-schema (5.2.6-1) ... Setting up php-composer-semver (1.4.2-1) ... Setting up php-cli-prompt (1.0.3+dfsg-1) ... Setting up php-composer-spdx-licenses (1.3.0-1) ... Setting up php-symfony-filesystem (3.4.6+dfsg-1ubuntu0.1) ... Setting up php-symfony-polyfill-mbstring (1.6.0-2) ... Setting up jsonlint (1.7.1-1) ... Setting up php-symfony-process (3.4.6+dfsg-1ubuntu0.1) ... Setting up php-symfony-debug (3.4.6+dfsg-1ubuntu0.1) ... Setting up php-symfony-console (3.4.6+dfsg-1ubuntu0.1) ... Setting up composer (1.6.3-1) ... Processing triggers for man-db (2.8.3-2ubuntu0.1) ... [email protected] /var/www/html/novagram # composer require skrtdev/novagram Do not run Composer as root/super user! See https://getcomposer.org/root for details Warning from https://packagist.org: You are using an outdated version of Composer. Composer 2.0 is now available and you should upgrade. See https://getcomposer.org/2 Using version ^1.2 for skrtdev/novagram ./composer.json has been updated Root package 'skrtdev/novagram' cannot require itself in its composer.json Did you accidentally name your root package after an external package?

    Additional context failed to install / build on ubuntu 18

    bug 
    opened by whittinghamj 2
  • Fix for missing entity 'hashtag' in EntitiesParser

    Fix for missing entity 'hashtag' in EntitiesParser

    skrtdev\NovaGram\Exception: Could not parse Message Entities: not found entity 'hashtag', please report issue - https://novagram.ga in /websites/tools/novagram/vendor/skrtdev/novagram/src/NovaGram/EntitiesParser.php:42

    opened by giuseppedima 0
  • composer req update

    composer req update

    Problem 1 - Root composer.json requires skrtdev/novagram ^1.10 -> satisfiable by skrtdev/novagram[v1.10]. - skrtdev/novagram v1.10 requires monolog/monolog ^2.1 -> found monolog/monolog[2.1.0, ..., 2.8.0] but it conflicts with your root composer.json require (^3.2).

    opened by Bazowsky 0
  • A Userbot  Undefined offset: 0 Error in Utils.php on line 43

    A Userbot Undefined offset: 0 Error in Utils.php on line 43

    I'm using a Userbot (modified it a little bit) with latest version of NovaGram and getting this error message:

    [Sun Jul 18 08:08:43.555377 2021] [php7:notice] [pid 64165] [client 185.242.180.125:35294] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 08:08:48.379605 2021] [php7:notice] [pid 64165] [client 185.242.180.125:35294] [2021-07-18T08:08:48.379454+07:00] NovaGram.CRITICAL: An Exception has been thrown inside internal error handling: skrtdev\\Telegram\\BadRequestException. Full exception has been printed to stdout. [] []
    [Sun Jul 18 08:11:18.587280 2021] [php7:notice] [pid 63104] [client 185.242.180.125:36244] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 08:11:18.779592 2021] [php7:notice] [pid 63104] [client 185.242.180.125:36244] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 08:12:24.947972 2021] [php7:notice] [pid 63101] [client 185.242.180.125:36594] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 08:12:25.145462 2021] [php7:notice] [pid 63101] [client 185.242.180.125:36594] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 08:15:02.117104 2021] [php7:notice] [pid 63075] [client 185.242.180.125:37408] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 08:15:02.309639 2021] [php7:notice] [pid 63075] [client 185.242.180.125:37408] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 08:15:06.676806 2021] [php7:notice] [pid 63075] [client 185.242.180.125:37408] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 08:15:10.633559 2021] [php7:notice] [pid 63075] [client 185.242.180.125:37408] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 08:22:00.243235 2021] [php7:notice] [pid 64165] [client 185.242.180.125:39584] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 08:22:00.435600 2021] [php7:notice] [pid 64165] [client 185.242.180.125:39584] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 09:17:15.537236 2021] [php7:notice] [pid 64166] [client 185.242.180.125:56718] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 09:17:15.731295 2021] [php7:notice] [pid 64166] [client 185.242.180.125:56718] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    [Sun Jul 18 09:35:41.126093 2021] [php7:notice] [pid 63073] [client 125.164.11.83:57684] PHP Notice:  Undefined offset: 0 in /var/www/robot/vendor/skrtdev/novagram/src/NovaGram/Utils.php on line 43
    

    What could have gone wrong? Is it because the token ID is my phone number (because I'm using Userbot)?

    opened by soulhd 9
Releases(v1.10)
PHP Telegram Bot based on the official Telegram Bot API

PHP Telegram Bot based on the official Telegram Bot API

null 4 Dec 8, 2021
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.

Telegram Bot API - PHP SDK Telegram Bot PHP SDK lets you develop Telegram Bots in PHP easily! Supports Laravel out of the box. Telegram Bot API is an

Irfaq Syed 2.5k Jan 6, 2023
A telegram bot to check credit cards. written in php & py

MRBANKER BOT A telegram bot to check credit cards. written in php & py. You can find me on telegram STEP1: goto botfather create a bot copy the token

Nitin1818 48 Dec 30, 2022
Integrate Your PHP Code With Telegram Bot API for Beginner

Documentation[https://core.telegram.org/bots/api] Resource[https://github.com/bachors/KBBI.sql] Integrate Your PHP Code With Telegram Bot API for Begi

Nova Andre Saputra 1 Oct 19, 2021
Simple telegram auto reminder BOT with PHP

Telebot Script Telegram BOT Auto Reminder Dibuat pake PHP OOP Sebenernya bukan buat dipublish sih, ini cuma buat praktek PHP OOP sama praktek Commit &

its Galih 4 Nov 7, 2022
A simple php telegram bot to check if the bin is valid or not!

Bin-Checker A simple php telegram bot to check if the bin is valid or not! Deploy FORK the Repo by clicking HERE Add your bot token in LINE 12 THEN DE

ʀᴇxɪɴᴀᴢᴏʀ 1 Nov 23, 2021
Simple php telegram bot.

PHPTGBot Description Simple php telegram bot. Just for fun ?? Work In Progress ?? Maybe found error, since im not tested yet! Still on working, so be

Yoga Pranata 2 Nov 24, 2021
PHP Source - Telegram Bot - Standart Method

Telegram Bot- yaratish uchun mo'ljallangan standart metod asosida ishlovchi, PHP tilida yozilgan kod Dasturchilarning eng yaxshi ko'rgan odati c/p bo'

Jabborov Abduroziq 4 Mar 30, 2022
A Php Checker Bot For Telegram.

A Card Checker Bot For Telegram Based On Telegram.

Roldex Stark 16 Dec 29, 2022
Fluent Keyboard builder for php-telegram-bot.

Table of Contents Installation Usage Defining a Keyboard Defining Buttons Bind Buttons to a Keyboard By Row By Button As Stack ForceReply and ReplyKey

PHP Telegram Bot 3 Sep 12, 2022
Robot increase telegram post 👁‍🗨Telegram Fake Posts Viewer👁‍🗨

Program Features - ?? Very and stylish design. - ?? It has glass buttons. - ?? Has a professional management panel. - ?? Has a user area. - ?? Free di

hack4lx 4 Nov 25, 2022
A tool for sending fast and managed messages to Telegram bot users

???? HiToAll A tool for sending fast and managed messages to Telegram bot users About In some telegram bots programmed with php language, if there are

Matin Najafi 3 Oct 3, 2021
telegram bot for sell virtual number

Telefake Telegram bot for sell virtual number (fully automatic) Installation create bot in telegram upload script in website with php and ssl (https)

reza malekpour 4 Aug 20, 2022
laravel package untuk memudahkan penggunaan MCA dengan Telegram Bot USDI di aplikasi Universitas Udayana.

MCA KubeMQ Laravel laravel package untuk memudahkan penggunaan MCA dengan Telegram Bot USDI di aplikasi Universitas Udayana. Motivasi Proyek ini berfu

Ristek USDI 1 Nov 17, 2021
Telegram bot for CC Checker with hella lotta features.

SDMN CHECKER BOT Telegram bot for CC Checker with hella lotta features. ?? Table of Contents Dependencies / Limitations Future Scope Setting up a Hero

Rohithaditya 5 Dec 19, 2022
Create and manage advanced polls with this Telegram Bot which has many features available!

MasterPollBot Create and manage advanced polls with this Telegram Bot which has many features available! Requirements Local Telegram Bot API or a webh

NeleB54Gold 7 Oct 21, 2022
Bin checker telegram bot

BIN Checker Bot Test Bot: Bin Checker Bot Env API_TOKEN Bot token. START_MSG Custom start message. Deploy Heroku Railway ⚠ Warn: Still not Tested on R

Yoga Pranata 4 Mar 6, 2022
This app remembers todo list in every specified time (e. every minute, hour, day etc) through telegram bot

remember_todo_list This app remembers todo list in every specified time (e. every minute, hour, day etc) through telegram bot This project includes tw

Saidburxon 1 Nov 27, 2021
The Telegram bot framework that doesn't drive you nuts.

Nutgram The Telegram bot framework that doesn't drive you nuts This framework takes advantage of the latest PHP 8 features, and tries to make the spee

Sergio Brighenti 209 Dec 26, 2022