{"slug": "i-built-an-open-source-telegram-bot-for-the-openai-codex-referral-promo", "title": "I Built an Open-Source Telegram Bot for the OpenAI Codex Referral Promo", "summary": "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.", "body_md": "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.\n\nThat's a poor user experience. And it's wasteful: every unused referral is a missed opportunity for someone who actually wants to try Codex.\n\nSo I built **@codexHuddbot** — a Telegram bot that solves the one-shot matching problem.\n\nA 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.\n\nThe bot handles duplicates (you can't submit the same link twice), tracks which links have been consumed, and provides a `/status`\n\ncommand.\n\nI wanted something that could ship in an afternoon and run reliably for the two-week promo window.\n\n`pip install aiohttp`\n\nand `systemctl start codex-buddy`\n\n. This is the live, running component.`wham/rate-limit-reset-credits/consume`\n\nendpoint. 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.\n\nThe 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.\n\nBoth 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.", "url": "https://wpnews.pro/news/i-built-an-open-source-telegram-bot-for-the-openai-codex-referral-promo", "canonical_source": "https://dev.to/aaamosh/i-built-an-open-source-telegram-bot-for-the-openai-codex-referral-promo-53lm", "published_at": "2026-06-17 22:07:32+00:00", "updated_at": "2026-06-17 22:21:20.025611+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "generative-ai"], "entities": ["OpenAI", "Codex", "Telegram", "GitHub", "Python", "aiohttp", "nginx", "SQLite"], "alternates": {"html": "https://wpnews.pro/news/i-built-an-open-source-telegram-bot-for-the-openai-codex-referral-promo", "markdown": "https://wpnews.pro/news/i-built-an-open-source-telegram-bot-for-the-openai-codex-referral-promo.md", "text": "https://wpnews.pro/news/i-built-an-open-source-telegram-bot-for-the-openai-codex-referral-promo.txt", "jsonld": "https://wpnews.pro/news/i-built-an-open-source-telegram-bot-for-the-openai-codex-referral-promo.jsonld"}}