Telegram bot monetization
A ready-made template that makes your Telegram bot earn money — in one Python file.
This repository plugs a Telegram bot into the MGRAM ad network. Before answering, the bot shows sponsor tasks (join a channel, start a bot) — that's a force-subscribe gate; after a useful answer it shows a short Reply Ad. You get 70% of every placement, from the very first user, with payouts in USDT. If MGRAM is unreachable or has no tasks, users simply go through — your bot never breaks.
Three lines in aiogram 3
from mgram_gate import MgramClient, MgramGate
gate = MgramGate(MgramClient(MGRAM_API_KEY))
gate.setup(dp) # sponsor tasks before the answer
await gate.show_ad(message) # an ad after the useful answer
How it works
| Step | The user sees | API call |
|---|
| 1 | Writes to your bot | — |
| 2 | Sponsor buttons and “✅ Check” | POST /tasks |
| 3 | Taps “Check” — access opens | POST /tasks/check |
| 4 | Your bot's answer | — |
| 5 | A short ad from your bot | POST /reply-ads/show |
Open-source repositories
Templates in other languages