Inspiration

Small businesses and freelance SMM specialists often know their audience and goals, but turning that information into a coherent content strategy takes time. I wanted to make this process faster and more accessible directly inside Telegram.

What it does

SMM Bot AI is a Telegram assistant for managing clients, collecting post ideas, drafting posts, and working with content plans.

During OpenAI Build Week, I added a focused AI feature: the user submits one short brief describing a product or niche, target audience, and promotion goal. The bot then generates a structured seven-day content plan.

Each day contains:

  • a publication goal;
  • a topic;
  • a Telegram-friendly format;
  • a key message;
  • a call to action.

The generated plan can be saved, viewed, searched, edited, and deleted using the bot's existing workflow.

How we built it

The bot is written in Python using aiogram and its finite-state-machine workflow.

The new feature uses the OpenAI Responses API with GPT-5.6 and low reasoning effort. Pydantic Structured Outputs validate the response before it is formatted for Telegram and saved.

The OpenAI request runs in a separate thread so it does not block the asynchronous Telegram bot. Authentication failures, rate limits, network problems, timeouts, invalid responses, and service errors are handled separately. A failed or incomplete response is never saved.

Codex helped me inspect the existing project, design the smallest useful Build Week feature, implement it, add type-safe OpenAI SDK integration, create offline tests, prepare documentation, and establish a safe Git and GitHub workflow.

Challenges we ran into

The main challenge was adding AI to an existing project without rewriting its architecture or breaking the current content-plan workflow.

I also needed to ensure that:

  • the model always returned exactly seven ordered days;
  • malformed or incomplete results were rejected;
  • API failures did not corrupt saved content;
  • Telegram message limits were respected;
  • API keys and local user data never entered the public repository

Accomplishments that we're proud of

I transformed an existing static content-plan template into a working AI-assisted workflow while preserving the bot's existing storage and editing features.

The result has:

  • Pydantic-validated Structured Outputs;
  • clear user-facing API error handling;
  • five passing offline tests;
  • a successful manual live smoke test;
  • safe secret and local-data handling;
  • documented before-and-after project history.

What we learned

I learned how to integrate the Responses API into an asynchronous Telegram bot, use Structured Outputs for dependable application data, and collaborate with Codex on a real codebase.

I also learned that a narrow, complete feature can provide more value than a large but unfinished prototype.

What's next for SMM Bot AI

After Build Week, I plan to improve per-user data isolation, migrate local text storage to a database, expand automated testing, and explore an optional local or free AI provider for users who do not want paid API usage.

Built during Build Week

SMM Bot existed before the event. The new Build Week contribution is the complete GPT-5.6-powered seven-day content-plan workflow, including validation, error handling, tests, documentation, and GitHub publication.

Built With

  • aiogram
  • codex
  • git
  • github
  • gpt-5.6
  • openai-api
  • pydantic
  • python
  • responces-api
  • structured-outputs
  • telegram-bit-api
Share this project:

Updates