PHPackages                             michyaraque/simpletelegrambot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. michyaraque/simpletelegrambot

ActiveLibrary[API Development](/categories/api)

michyaraque/simpletelegrambot
=============================

A complete Telegram bot API implementation written in PHP, with support for inline bots and fully componetized!

v1.0.0(4y ago)11PHPPHP &gt;=7.2.0

Since Nov 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/michyaraque/Simple-TelegramBot)[ Packagist](https://packagist.org/packages/michyaraque/simpletelegrambot)[ RSS](/packages/michyaraque-simpletelegrambot/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Simple Componetized Telegram BOT
================================

[](#simple-componetized-telegram-bot)

Imagine being able to create a bot with a few steps and each menu or function as if it were a method of a class. I have developed this tool to make it easier to create bots that require interaction between several screens.

Project overview
================

[](#project-overview)

### Prerequisites

[](#prerequisites)

```
- PHP >= 7.4
- Redis
- Mysql Mariadb
- Domain with SSL

```

### Features

[](#features)

- Components inside another components
- Easy component creation
- Easy step proccess

### How to use Components

[](#how-to-use-components)

In the event Events folder you can create a bunch of different loader or separated bots.

Events Folder Structure

```
Events
   └── example
       ├── main.php
       └── __query_helpers.php
```

To load this structure folder you have to define in the public folder

```
$events = new EventLoader(Updates::userId(), Updates::language());
$events->setPath('example');
$events->forceEvents(['main.php', '__query_helpers.php']);
$events->getEvents();
```

In main.php you have to declare the Components route like this

```
Component::group('Example', function ($component) {
    $component->include('initialPanels')->get([
        'start' => ['commands' => ['start', 'cancel']],
    ])->init();
});
```

- `start` refers to the static function inside the `initialPanels` folder that is inside the `Example` path
- `initialPanels` has to be named as `InitialPanelsComponent.php`

The folder structure of the components is as follows and you can add as many as you like

```
Components
   ├── Example
   │   └── InitialPanelsComponent.php
   └── Component.php
```

### initialPanelsComponent.php overview

[](#initialpanelscomponentphp-overview)

```
