Download the PHP package nutgram/starter-kit without Composer
On this page you can find all versions of the php package nutgram/starter-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nutgram/starter-kit
More information about nutgram/starter-kit
Files in nutgram/starter-kit
Package starter-kit
Short Description Starter kit for Nutgram
License MIT
Homepage https://github.com/nutgram/starter-kit
Informations about the package starter-kit
Nutgram Starter Kit
This is a lightweight starter kit for building Telegram bots using the Nutgram PHP framework.
Features
- Nutgram Framework: High-performance Telegram Bot framework.
- Environment Configuration: Easy management of environment variables with
phpdotenv. - Caching: PSR-16 cache support out of the box.
- Testing: Ready-to-use testing environment with Pest.
- Structured: Organized directory structure for Commands and Conversations.
Requirements
- PHP 8.2 or higher
- Composer
Usage
-
Create the project:
-
Install dependencies:
-
Configure the environment: Copy the example environment file and add your Telegram Bot token:
Edit
.envand set yourTOKEN:
Usage
Running the Bot
Polling Mode
To run the bot in polling mode (ideal for development), execute:
Webhook Mode
To use the webhook mode, point your web server's document root to the public/ directory. Ensure your server is accessible via HTTPS.
Finally, you need to register your webhook URL with Telegram. You can do this by making an HTTP request (e.g., using curl) to the following address:
Replace:
TOKENwith the same value you used in your.envfilehttps://YOUR_DOMAINwith your actual webhook URL.WEBHOOK_TOKENwith the same value you used in your.envfile
Project Structure
src/routes.php: Register your commands, conversations, and handlers.src/bootstrap.php: Bot initialization and configuration.public/index.php: Entry point for both polling and webhook.tests/: Feature and unit tests.
Running Tests
You can run the tests using Pest:
License
This project is open-sourced software licensed under the MIT license.
All versions of starter-kit with dependencies
nutgram/nutgram Version ^4.40.0
vlucas/phpdotenv Version ^5.6
symfony/cache Version ^8.0