<?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: Dmytro</title>
    <description>The latest articles on DEV Community by Dmytro (@lollyres).</description>
    <link>https://dev.to/lollyres</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3073116%2F791de4cc-fff9-4c22-a18e-4857856ed0f5.jpg</url>
      <title>DEV Community: Dmytro</title>
      <link>https://dev.to/lollyres</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lollyres"/>
    <language>en</language>
    <item>
      <title>Why I Built a Modern TypeScript SDK for Telegram Bots (and You Should Use It Too)</title>
      <dc:creator>Dmytro</dc:creator>
      <pubDate>Tue, 22 Apr 2025 01:08:43 +0000</pubDate>
      <link>https://dev.to/lollyres/why-i-built-a-modern-typescript-sdk-for-telegram-bots-and-you-should-use-it-too-4boj</link>
      <guid>https://dev.to/lollyres/why-i-built-a-modern-typescript-sdk-for-telegram-bots-and-you-should-use-it-too-4boj</guid>
      <description>&lt;p&gt;When I first started building Telegram bots in Node.js, I expected it to be fun.&lt;br&gt;
But pretty quickly I ran into a familiar wall: boilerplate, manual wiring, poor DX (developer experience). You know how it goes.&lt;/p&gt;

&lt;p&gt;You want to just send a message or set a webhook — and instead, you’re copy-pasting code from Stack Overflow, manually writing fetch requests, building URLs by hand, and dealing with vague error messages like "Bad Request" with no clue what’s wrong.&lt;/p&gt;

&lt;p&gt;There are libraries out there, sure. But most of them are either outdated, bloated, or just not friendly if you’re building something serious, especially with TypeScript.&lt;/p&gt;

&lt;p&gt;That’s when I realized:&lt;br&gt;
I’d rather invest time into building a clean SDK than keep fighting with spaghetti code every time I need a bot.&lt;/p&gt;

&lt;p&gt;So I built gramflow — a modern, minimalistic, developer-focused SDK for the Telegram Bot HTTP API.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;🚀 What makes gramflow different?&lt;br&gt;
    • Uses native fetch — no weird wrappers, no magic&lt;br&gt;
    • Fully typed — thanks to TypeScript, your IDE is your best friend&lt;br&gt;
    • Clear structure — BotService, httpClient, and typed error handlers&lt;br&gt;
    • Built with readability and extensibility in mind&lt;br&gt;
    • Works out of the box with NestJS, Express, and Fastify&lt;br&gt;
    • Easy to test, easy to reason about, easy to extend&lt;/p&gt;

&lt;p&gt;No classes trying to be too smart. No runtime hacks. Just clean, modern code.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;🛠 What’s under the hood?&lt;br&gt;
    • 💡 A lightweight and testable httpClient&lt;br&gt;
    • 🔒 Custom error types like ChatNotFoundError, UnauthorizedError, and more&lt;br&gt;
    • 🎯 Consistent DTOs and response contracts&lt;br&gt;
    • ✅ Unit tests using nock and jest so you don’t have to test Telegram’s servers&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;📦 Quick install&lt;/p&gt;

&lt;p&gt;npm i @oravone/gramflow&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;📚 Example usage&lt;/p&gt;

&lt;p&gt;import { BotService } from '@oravone/gramflow';&lt;/p&gt;

&lt;p&gt;const bot = new BotService('123:ABC');&lt;/p&gt;

&lt;p&gt;const info = await bot.getMe();&lt;br&gt;
console.log(info.username); // your bot’s username&lt;/p&gt;

&lt;p&gt;await bot.setWebhook({ url: '&lt;a href="https://yourapp.com/webhook" rel="noopener noreferrer"&gt;https://yourapp.com/webhook&lt;/a&gt;' });&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;🤝 What’s next?&lt;/p&gt;

&lt;p&gt;gramflow is just getting started, but the roadmap is 🔥:&lt;br&gt;
    • Support for receiving updates (long polling / webhook parsing)&lt;br&gt;
    • More Telegram methods: sendMessage, sendPhoto, editMessageText, and others&lt;br&gt;
    • Middlewares and interceptors for clean message flows&lt;br&gt;
    • NestJS-ready module: GramflowModule&lt;br&gt;
    • Auto-generated types based on Telegram Bot API schema (like OpenAPI)&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;❤️ Why I’m building this&lt;/p&gt;

&lt;p&gt;Because bots are awesome — but the ecosystem should be better.&lt;br&gt;
Because we deserve better DX, and less boilerplate.&lt;br&gt;
Because I wanted a tool I would actually enjoy using.&lt;/p&gt;

&lt;p&gt;If you’ve ever built bots in Node or TypeScript and thought “ugh, again?”, this is for you.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;🧠 Final thoughts&lt;/p&gt;

&lt;p&gt;gramflow is still early, but growing fast. I’m actively adding features, testing real-world use cases, and planning integration with frameworks and automation tools.&lt;/p&gt;

&lt;p&gt;If this sounds interesting — check out the GitHub repo, leave a ⭐, open an issue, or just drop a “hey” in discussions.&lt;br&gt;
I’d love to hear your ideas, feedback, or even feature requests.&lt;/p&gt;

&lt;p&gt;Let’s make bot development joyful again.&lt;br&gt;
Let’s build something cool — together 👨‍💻🔥&lt;/p&gt;

&lt;p&gt;With ❤️ from Me and Oravone Team&lt;/p&gt;

</description>
      <category>programming</category>
      <category>bot</category>
      <category>typescript</category>
      <category>node</category>
    </item>
  </channel>
</rss>
