Laravel Cloud is here! Zero-config managed infrastructure for Laravel apps. Deploy now.

Nutgram

nutgram/nutgram image

Nutgram stats

Downloads
19.8K
Stars
337
Open Issues
2
Forks
33

View on GitHub →

The Telegram bot library that doesn't drive you nuts


The Telegram bot framework that doesn't drive you nuts.

This framework takes advantage of the latest PHP 8.2 features, and tries to make the speed, scalability and flexibility of use its strength, it will allow you to quickly make simple bots, but at the same time, it provides more advanced features to handle even the most complicated flows.

<?php
 
use SergiX44\Nutgram\Nutgram;
 
$bot = new Nutgram($_ENV['TOKEN']);
 
$bot->onCommand('start', function(Nutgram $bot) {
$bot->sendMessage('Ciao!');
});
 
$bot->onText('My name is {name}', function(Nutgram $bot, string $name) {
$bot->sendMessage("Hi $name");
});
 
$bot->run();

πŸš€ Installation

You can install the package via composer:

composer require nutgram/nutgram

Looking for a Laravel or Symfony integration? Check out Nutgram Laravel and Nutgram Symfony Bundle.

πŸ‘“ Usage

Official Documentation on https://nutgram.dev/

🧩 Features

  • Latest PHP 8.2 features
  • Framework agnostic
  • Framework integrations (Laravel and Symfony)
  • Cache system (you can use your own cache system that implements PSR-16 CacheInterface)
  • Logging system (you can use your own logger that implements PSR-3 LoggerInterface)
  • Flexible update processing
  • Supports all types and methods according to the last Telegram Bot API update
  • Handlers system
  • Middleware system
  • Grouping system to apply middleware and scopes to multiple handlers
  • Auto-registration of bot commands with scope support
  • Helpers for common tasks and proxy methods for a shorter syntax
  • Storage system for global and user data
  • Enhanced keyboard management
  • Conversations system
  • InlineMenu class for easy creation of inline menu messages
  • Extend Nutgram class and Telegram types with user-created methods
  • Bulk message sending
  • Chunked message sending
  • Using enums where possible
  • Customizable error handling
  • Testing system
  • Nutgram Generator to quickly update the framework to the latest Telegram Bot API version (WIP)

πŸ”° Supported versions

Nutgram PHP Support Until
^3.0 ^8.0 2023-11-26
^4.0 ^8.2 -

✨ Projects with this library

Is your project using Nutgram? Let us know, feel free to add yours!

βš—οΈ Testing

composer test

πŸ“ƒ Changelog

Please see CHANGELOG for more information on what has changed recently.

πŸ… Credits

πŸ“– License

The MIT License (MIT). Please see License File for more information.

nutgram photo

The Telegram bot framework that doesn't drive you nuts.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Nutgram Nutgram Related Articles

Laravel 7.7 Released With Variadic Container Support image

Laravel 7.7 Released With Variadic Container Support

Read article
Statamic logo

Statamic

The drop-in ready Laravel CMS you’re been waiting for. Go full-stack or headless, flat file or database – it’s up to you.

Statamic
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
CodeKudu logo

CodeKudu

Stand-ups, Retrospectives, and 360Β° Feedback for the entire team. 50% off with code LARAVELNEWS.

CodeKudu
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec