cd /news/developer-tools/i-built-an-open-source-telegram-bot-… · home topics developer-tools article
[ARTICLE · art-31809] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

I Built an Open-Source Telegram Bot for the OpenAI Codex Referral Promo

A developer built an open-source Telegram bot called @codexHuddbot to solve the one-shot referral matching problem for OpenAI's Codex referral promo. The bot stores referral links in a queue and matches them one-to-one on demand, preventing wasted referrals. The project is MIT-licensed and available on GitHub.

read2 min views3 publishedJun 17, 2026

OpenAI dropped Codex referral links on June 12. Seven days of free Codex Pro for you, seven days for a friend. The catch? Each referral code can only be used once. Post your link on social media and the first person to click it claims it — everyone else gets "this referral has already been used." One shot, gone.

That's a poor user experience. And it's wasteful: every unused referral is a missed opportunity for someone who actually wants to try Codex.

So I built @codexHuddbot — a Telegram bot that solves the one-shot matching problem.

A user sends their Codex referral link to the bot. The bot stores it in a queue. When another user asks for a referral, the bot dequeues the oldest link, marks it as claimed, and sends it privately. No public link dumps. No race conditions. No wasted referrals. One-to-one matching, on demand.

The bot handles duplicates (you can't submit the same link twice), tracks which links have been consumed, and provides a /status

command.

I wanted something that could ship in an afternoon and run reliably for the two-week promo window.

pip install aiohttp

and systemctl start codex-buddy

. This is the live, running component.wham/rate-limit-reset-credits/consume

endpoint. For Linux and headless users who never see the in-editor popup — they'd otherwise leave those credits unused.~500 lines of application code. Two repos, MIT-licensed.

The promo ends June 24. After that, the bot's core function retires. But the architecture — a lightweight Python aiohttp server behind nginx, backed by SQLite — is reusable for any time-limited Telegram bot. The code is clean enough to serve as a reference, and the referral-matching logic is a simple queue pattern you can adapt.

Both MIT-licensed. Stars, issues, and PRs welcome. The promo ends June 24 — if you've got an unused referral link, now's the time to share it.

── more in #developer-tools 4 stories · sorted by recency
── more on @openai 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-an-open-sour…] indexed:0 read:2min 2026-06-17 ·