Download the PHP package bots8/nutgram-starter-kit without Composer
On this page you can find all versions of the php package bots8/nutgram-starter-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bots8/nutgram-starter-kit
More information about bots8/nutgram-starter-kit
Files in bots8/nutgram-starter-kit
Package nutgram-starter-kit
Short Description A starter kit for building telegram bot with Nutgram
License MIT
Informations about the package nutgram-starter-kit
Nutgram Starter Kit
Start your Telegram bot development journey with this simple starter kit, designed for beginners. It offers essential tools and guidelines to easily build your first Telegram bot, making it a great choice for those looking to create a ready-to-use bot for production.
Read nutgram documentation since this starter kit using that Library as core component (version 3.x)
Main Features
- Well-structured folder
- Ease database integration
- CLI for development
- Testing kit (Pest)
- Ready for production
Requirements
Before you begin, ensure that you have the following requirements installed:
- PHP 8.1 or higher
- cURL extension for PHP
- Database (optional)
Installation
- Clone the repository to your local machine or using composer:
Configuration
-
Copy the
.env.example
file and rename it to.env
: - Open the
.env
file in a text editor and update theBOT_TOKEN
with your actual bot token.
Structure
- app/
- Commands/: This directory contains command classes for your bot application.
- Conversations/: This directory contains conversation classes for your bot application.
- Database/: This directory contains database-related classes for your bot application.
- Middleware/: This directory contains middleware classes for your bot application.
- Kernel.php: This file is the application's console kernel, which handles command execution and provides a central location for registering all of the application's console commands and more.
- library/: This directory can be used to store any additional libraries or utilities your bot might need. You can organize this folder based on your project's specific requirements.
- .env.example: This file serves as an example configuration file. It includes placeholders for environment variables that your application might need. Make a copy of this file as
.env
and fill in the actual values. - bootstrap.php: This file is added to initialize the application. It may contain any necessary setup or bootstrapping logic.
- handler.php: This file is an example webhook handler. You can customize this file to handle incoming updates from Telegram.
- index.php: The main entry point of your bot. You may include your application logic or use it to bootstrap your bot.
- tests/: This directory contains test scripts and suites to verify the functionality and behavior of your bot application.
- console/: This directory houses command-line scripts and utilities for managing and interacting with your bot application.
Usage
-
For production release, run the
webhook
command to set up your webhook: -
Start your bot application (development):
- Or if you want to remove webhhok:
Working with Database
You can easily interact with database but for now you can only working with supported PDO Database, here a few example code to use query builder
More method like: update($arr)
, count()
, delete()
, increment($col)
License
This Nutgram Starter Kit is open-sourced software licensed under the MIT license.
Feel free to customize, extend, and share your bot based on this starter kit. Happy coding!
All versions of nutgram-starter-kit with dependencies
nutgram/nutgram Version 3.20.2
symfony/cache Version 6.4.2
symfony/console Version 6.4.2
spatie/ray Version ^1.41