<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: aaamosh</title>
    <description>The latest articles on DEV Community by aaamosh (@aaamosh).</description>
    <link>https://dev.to/aaamosh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3989834%2Fe049eac7-87c2-4f58-a92a-ef9e554b960d.png</url>
      <title>DEV Community: aaamosh</title>
      <link>https://dev.to/aaamosh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aaamosh"/>
    <language>en</language>
    <item>
      <title>I Built an Open-Source Telegram Bot for the OpenAI Codex Referral Promo</title>
      <dc:creator>aaamosh</dc:creator>
      <pubDate>Wed, 17 Jun 2026 22:07:32 +0000</pubDate>
      <link>https://dev.to/aaamosh/i-built-an-open-source-telegram-bot-for-the-openai-codex-referral-promo-53lm</link>
      <guid>https://dev.to/aaamosh/i-built-an-open-source-telegram-bot-for-the-openai-codex-referral-promo-53lm</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;@codexHuddbot&lt;/strong&gt; — a Telegram bot that solves the one-shot matching problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;The bot handles duplicates (you can't submit the same link twice), tracks which links have been consumed, and provides a &lt;code&gt;/status&lt;/code&gt; command.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture: boring tech, fast delivery
&lt;/h2&gt;

&lt;p&gt;I wanted something that could ship in an afternoon and run reliably for the two-week promo window.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;buddy-server&lt;/strong&gt;: A ~500-line Python aiohttp server on a VPS behind nginx with a self-signed certificate. REST API for submitting and claiming referrals, backed by SQLite. No ORM, no migrations, no Docker — just &lt;code&gt;pip install aiohttp&lt;/code&gt; and &lt;code&gt;systemctl start codex-buddy&lt;/code&gt;. This is the live, running component.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;buddy-bot&lt;/strong&gt;: A Cloudflare Worker (free tier) planned to proxy between Telegram's Bot API and the buddy-server — keeping the server's IP hidden and handling webhook requirements. Currently the bot uses Telegram polling directly; the Worker is the next step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;codex-reset&lt;/strong&gt;: A companion CLI that consumes "banked" rate-limit reset credits via the OpenAI Codex &lt;code&gt;wham/rate-limit-reset-credits/consume&lt;/code&gt; endpoint. For Linux and headless users who never see the in-editor popup — they'd otherwise leave those credits unused.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;~500 lines of application code. Two repos, MIT-licensed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why open source?
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Telegram bot&lt;/strong&gt;: &lt;a href="https://t.me/codexHuddbot" rel="noopener noreferrer"&gt;@codexHuddbot&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;codex-hud repo&lt;/strong&gt;: &lt;a href="https://github.com/aaamosh/codex-hud" rel="noopener noreferrer"&gt;github.com/aaamosh/codex-hud&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;codex-reset repo&lt;/strong&gt;: &lt;a href="https://github.com/aaamosh/codex-reset" rel="noopener noreferrer"&gt;github.com/aaamosh/codex-reset&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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.&lt;/p&gt;

</description>
      <category>codex</category>
      <category>telegram</category>
      <category>opensource</category>
      <category>python</category>
    </item>
  </channel>
</rss>
