PHPackages                             tourze/lark-custom-bot-bundle - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tourze/lark-custom-bot-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

tourze/lark-custom-bot-bundle
=============================

飞书自定义机器人集成包

0.0.1(7mo ago)00MITPHPCI passing

Since Nov 18Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/tourze/lark-custom-bot-bundle)[ Packagist](https://packagist.org/packages/tourze/lark-custom-bot-bundle)[ RSS](/packages/tourze-lark-custom-bot-bundle/feed)WikiDiscussions master Synced today

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

Lark Custom Bot Bundle
======================

[](#lark-custom-bot-bundle)

[English](README.md) | [中文](README.zh-CN.md)

[![Latest Version](https://camo.githubusercontent.com/82f02161f4698ba71e1fc059956cc610a8243e8ddab0a8659fc32da3ab5bc732/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f6c61726b2d637573746f6d2d626f742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/lark-custom-bot-bundle)[![Total Downloads](https://camo.githubusercontent.com/f431d8d12facd4a15a35c569d1fed96f462011c2e963d534b40e15bebc0be321/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f6c61726b2d637573746f6d2d626f742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/lark-custom-bot-bundle)[![License](https://camo.githubusercontent.com/6c711032aff1ca0eb6b211aa6cb3649ce7fd64a7714e1181d4bb457f9680e7cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

[![PHP Version](https://camo.githubusercontent.com/611a140ab10bebdb8495fb585c407ad904612e20757c4ed9c1898367be1e3061/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746f75727a652f6c61726b2d637573746f6d2d626f742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/lark-custom-bot-bundle)[![Build Status](https://camo.githubusercontent.com/0346e18af1343d739d0405776c07b83798d5bb0200e3efcfdf657e5e662f6403/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f75727a652f7068702d6d6f6e6f7265706f2f63692e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/tourze/php-monorepo/actions)[![Coverage Status](https://camo.githubusercontent.com/73ee3bab50824f778cedc6b4b3f78bcdab621eef812a979ec388b8ad692a4bff/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746f75727a652f7068702d6d6f6e6f7265706f2e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/tourze/php-monorepo)

Introduction
------------

[](#introduction)

This Symfony bundle enables integration and management of Lark (Feishu) custom bots, supporting multiple message types (text, image, share chat, post, interactive card) with unified entity management and automated message delivery.

Features
--------

[](#features)

- Supports various Lark message types: text, image, share chat, post (rich text), interactive card
- Decoupled webhook configuration, allowing management of multiple bots
- Persistent message entities for traceability
- Automated message sending (entity persistence triggers push)
- Extensible entity design for easy customization

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Symfony &gt;= 7.3
- Doctrine ORM &gt;= 3.0

Installation
------------

[](#installation)

### Install

[](#install)

```
composer require tourze/lark-custom-bot-bundle
```

### Configuration

[](#configuration)

1. Configure your database and run migrations.
2. Register the bundle in `config/bundles.php`:

```
LarkCustomBotBundle\LarkCustomBotBundle::class => ['all' => true],
```

3. Optionally customize `services.yaml` as needed.

Quick Start
-----------

[](#quick-start)

### Create a Webhook Configuration

[](#create-a-webhook-configuration)

```
$webhook = new WebhookUrl();
$webhook->setName('Notify Bot');
$webhook->setUrl('https://open.feishu.cn/open-apis/bot/v2/hook/xxx');
$webhook->setRemark('Main notification bot');
$webhook->setValid(true);
```

### Send a Text Message

[](#send-a-text-message)

```
$text = new TextMessage();
$text->setWebhookUrl($webhook);
$text->setContent('Hello, Lark bot!');
$entityManager->persist($text);
$entityManager->flush();
// Message will be sent automatically, no manual send required
```

### For image, post, and card messages, refer to the entity design documentation

[](#for-image-post-and-card-messages-refer-to-the-entity-design-documentation)

Advanced Usage
--------------

[](#advanced-usage)

### Custom Message Types

[](#custom-message-types)

You can extend the base `AbstractMessage` class to create custom message types:

```
use LarkCustomBotBundle\Entity\AbstractMessage;

class CustomMessage extends AbstractMessage
{
    public function getType(): string
    {
        return 'custom';
    }

    public function toArray(): array
    {
        return [
            'msg_type' => $this->getType(),
            'content' => [
                // Your custom message content
            ],
        ];
    }
}
```

### Webhook Management

[](#webhook-management)

Manage multiple webhook configurations for different scenarios:

```
// Development bot
$devWebhook = new WebhookUrl();
$devWebhook->setName('Dev Notifications');
$devWebhook->setUrl('https://open.feishu.cn/open-apis/bot/v2/hook/dev-xxx');

// Production bot
$prodWebhook = new WebhookUrl();
$prodWebhook->setName('Prod Alerts');
$prodWebhook->setUrl('https://open.feishu.cn/open-apis/bot/v2/hook/prod-xxx');
```

### Event Listener Customization

[](#event-listener-customization)

The bundle includes an event listener that automatically sends messages. You can customize or disable this behavior in your services configuration.

### Message Validation

[](#message-validation)

All message entities include built-in validation constraints. Ensure your data passes validation before persisting:

```
use Symfony\Component\Validator\Validator\ValidatorInterface;

$violations = $validator->validate($textMessage);
if (count($violations) > 0) {
    // Handle validation errors
}
```

Documentation
-------------

[](#documentation)

- [Entity Design](./ENTITY.md)
- [Workflow &amp; Architecture Diagram](./WORKFLOW.md)

Contributing
------------

[](#contributing)

- Issues and PRs are welcome
- Follow PSR-12 coding style
- Ensure tests pass before submitting

License
-------

[](#license)

MIT License

Changelog
---------

[](#changelog)

- 0.1.0: Initial release

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

228d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13899502?v=4)[tourze](/maintainers/tourze)[@tourze](https://github.com/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-lark-custom-bot-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-lark-custom-bot-bundle/health.svg)](https://phpackages.com/packages/tourze-lark-custom-bot-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M577](/packages/shopware-core)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
