Search by

afaztech / reactor-ad

afaztech

Headless random and start ad delivery for Reactor bots.

Package info

github.com/AfazTech/reactor-ad

Type:reactor-package

pkg:composer/afaztech/reactor-ad

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.0 2026-10-23 16:06 UTC

This package is auto-updated.

Last update: 2026-10-23 17:56:10 UTC


README

PHP Version License Reactor

Ad slot management for Reactor Telegram bots.

Features

  • Named ad slots
  • Deterministic delivery per call
  • Probabilistic delivery per call
  • Configurable delivery probability per slot
  • Copy or forward strategy per slot
  • Enable or disable each slot independently
  • Configure source chat and message per slot
  • Clear a slot without touching other slots

Requirements

  • afaztech/reactor-framework ^0.5.0

Installation

composer require afaztech/reactor-ad
./reactor migrate

Usage

use AfazTech\ReactorAd\Contracts\AdManagerInterface;

$ads = $container->get(AdManagerInterface::class);

// Create a slot and configure it.
$ads->createSlot('welcome');
$ads->setSource('welcome', 'copy', -1001234567890, 42);
$ads->setProbability('welcome', 30);

// Deliver from your own handlers / listeners.
$ads->send('welcome', $userId);        // deterministic
$ads->sendRandom('welcome', $userId);  // probabilistic (30%)

Documentation

For detailed documentation, see DOCUMENT.md.

Contributing

Contributions are welcome. Please read the contribution guidelines.

License

This project is licensed under the MIT License.