telegram-bot-essentials / affiliates
Referral tracking and wallet commission payouts for telegram-bot-essentials/essence
Package info
github.com/Telegram-Bot-Essentials/affiliates
pkg:composer/telegram-bot-essentials/affiliates
Requires
- php: ^8.3
- brick/math: >=0.14.2 <1.0
- laravel/framework: ^12 || ^13
- telegram-bot-essentials/billing: ~0.0.32
- telegram-bot-essentials/essence: ^0.19.0-beta.9@beta
- telegram-bot-essentials/settings: ~0.0.17
- telegram-bot-essentials/user-wallet: ~0.0.22
Requires (Dev)
- filament/filament: ^5.11
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^3.7 || ^4.0
- pestphp/pest-plugin-laravel: ^3.1 || ^4.0
- telegram-bot-essentials/announcements: ~0.0.26
- telegram-bot-essentials/user-management: ~0.0.17
Suggests
- telegram-bot-essentials/announcements: Lets announcement texts show each recipient's referral link and earnings, and adds an alert that introduces the programme.
- telegram-bot-essentials/user-management: Adds an affiliation section to a member's profile in the admin user list.
Provides
None
Conflicts
Replaces
None
- dev-main
- v0.0.38
- v0.0.37
- v0.0.36
- v0.0.35
- v0.0.34
- v0.0.33
- v0.0.32
- v0.0.31
- v0.0.30
- v0.0.29
- v0.0.28
- v0.0.27
- v0.0.26
- v0.0.25
- v0.0.24
- v0.0.23
- v0.0.22
- v0.0.21
- v0.0.20
- v0.0.19
- v0.0.18
- v0.0.17
- v0.0.16
- v0.0.15
- v0.0.14
- v0.0.13
- v0.0.12
- v0.0.11
- v0.0.10
- v0.0.9
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- 0.0.2
- 0.0.1
This package is auto-updated.
Last update: 2026-11-15 13:51:16 UTC
README
A referral program for the
telegram-bot-essentials/essence
ecosystem. Every user gets a shareable deep link; signups through it are tracked; both the
referrer and (optionally) the new user can be paid a signup bonus; and referrers earn an
ongoing commission on their referred users' purchases. Bonuses and commissions are paid
straight into user-wallet.
Depends on essence's deep-link handling,
settings,
billing events, and
user-wallet.
Installation
composer require telegram-bot-essentials/affiliates php artisan migrate
Everything is configured per-bot through Settings:
| Setting | Type | Default |
|---|---|---|
affiliates.affiliates_status |
CHECKBOX |
false |
affiliates.allow_existing_users |
CHECKBOX |
false |
affiliates.share_percentage |
NUMBER |
10 |
affiliates.referrer_signup_bonus |
NUMBER |
0 |
affiliates.referred_signup_bonus |
NUMBER |
0 |
affiliates.share_tagline |
TEXT |
— |
How it works
- Each user's affiliate menu builds
https://t.me/{bot}?start={referral_code}. - A new user opening that link fires essence's
BotDeepLinkReceived; the package creates aReferraland pays the signup bonuses. - Attribution is first-touch-wins (a
unique(bot_id, bot_user_id)constraint) and, by default, new users only. Self-referral is rejected. - Every paid Billing invoice from a referred user credits the referrer a percentage (rounded down, wallet top-ups excluded). A later invoice revocation claws it back.
Commission listeners are queued (queue: billing) and restore the webhook context first,
since invoice events can fire from a gateway callback with no "current user".
Documentation
Full documentation — the attribution rules, commission math, data model, and member UI — lives on the Telegram Bot Essentials documentation site under Modules → Affiliates.
License
MIT.