nutgram / nutgram
The Telegram bot library that doesn't drive you nuts
Installs: 63 857
Dependents: 7
Suggesters: 0
Security: 0
Stars: 510
Watchers: 11
Forks: 57
Open Issues: 3
Requires
- php: ^8.2
- ext-json: *
- guzzlehttp/guzzle: ^7.2
- illuminate/macroable: >=9.0
- laravel/serializable-closure: ^1.2
- nutgram/hydrator: ^6.0
- psr/log: ^1.0|^2.0|^3.0
- psr/simple-cache: ^1.0|^2.0|^3.0
- sergix44/container: ^3.0
Requires (Dev)
- ext-reflection: *
- pestphp/pest: ^2.5
- pestphp/pest-plugin-mock: ^2.0
- roave/security-advisories: dev-latest
- vimeo/psalm: ^5.7.7
- dev-master
- 4.27.1
- 4.27.0
- 4.26.1
- 4.26.0
- 4.25.0
- 4.24.0
- 4.23.0
- 4.22.1
- 4.22.0
- 4.21.1
- 4.21.0
- 4.20.0
- 4.19.2
- 4.19.1
- 4.19.0
- 4.18.0
- 4.17.1
- 4.17.0
- 4.16.0
- 4.15.2
- 4.15.1
- 4.15.0
- 4.14.3
- 4.14.2
- 4.14.1
- 4.14.0
- 4.13.1
- 4.13.0
- 4.12.1
- 4.12.0
- 4.11.2
- 4.11.1
- 4.11.0
- 4.10.0
- 4.9.1
- 4.9.0
- 4.8.0
- 4.7.0
- 4.6.0
- 4.5.3
- 4.5.2
- 4.5.1
- 4.5.0
- 4.4.1
- 4.4.0
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.0
- 4.1.1
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- 4.0.0-rc.3
- 4.0.0-rc.2
- 4.0.0-rc.1
- 3.x-dev
- 3.20.2
- 3.20.1
- 3.20.0
- 3.19.0
- 3.18.0
- 3.17.2
- 3.17.1
- 3.17.0
- 3.16.0
- 3.15.3
- 3.15.2
- 3.15.1
- 3.15.0
- 3.14.0
- 3.13.1
- 3.13.0
- 3.12.1
- 3.12.0
- 3.11.2
- 3.11.1
- 3.11.0
- 3.10.0
- 3.9.0
- 3.8.1
- 3.8.0
- 3.7.9
- 3.7.8
- 3.7.7
- 3.7.6
- 3.7.5
- 3.7.4
- 3.7.3
- 3.7.2
- 3.7.1
- 3.7.0
- 3.6.0
- 3.5.1
- 3.5.0
- 3.4.0
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.0
- 2.1.1
- 2.1
- 2.0.0
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.0
- 0.16.0
- 0.15.10
- 0.15.9
- 0.15.8
- 0.15.7
- 0.15.6
- 0.15.5
- 0.15.4
- 0.15.3
- 0.15.2
- 0.15.1
- 0.15.0
- 0.14.1
- 0.14.0
- 0.13.1
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.1
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.1
- 0.4.0
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.2
- 0.1.1
- 0.1
- dev-psalm
- dev-analysis-APMBVK
- dev-fix-bugs
This package is auto-updated.
Last update: 2024-10-10 21:15:09 UTC
README
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
- Web Validation
- Testing system
- Deep Link helper class
🔰 Supported versions
✨ Projects with this library
Is your project using Nutgram? Let us know, feel free to add yours!
- AnonyMeet (@AnonyMeetBot) - Anonymous chat bot
- File Converter (@newfileconverterbot) - Convert files to other formats
- Sticker Optimizer (@NewStickerOptimizerBot) - Optimize images for the @stickers bot
- Stickerizer (@StickerizerBot) - Create stickers on the fly, via Telegram Mini App.
- Mermaid Generator (@newmermaidbot) - Generate mermaid diagrams from text
- Voice Transcriber (@voicetranscriberobot) - Transcribe audio messages to text
- Effin Birds (@effinbirdsbot) - Search and send in inline mode images made by https://twitter.com/EffinBirds
- Resizer Image (@ResizerTool_bot)] - Resize an image easily
⚗️ 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.