Skip to content

Teleflow v0.9.0 - Major API Simplification and Enhanced Documentation

Choose a tag to compare

@kslamph kslamph released this 15 Sep 14:09
· 28 commits to master since this release
v0.9.0
c51e372

Teleflow v0.9.0 Release Notes

This release represents a major milestone in the evolution of Teleflow, with significant improvements to the API, documentation, and overall developer experience. The framework has been simplified and enhanced to make building Telegram bots even easier.

🎯 Major Improvements

Simplified API

  • Refactored the core Teleflow API for improved simplicity and consistency
  • Enhanced flow management with streamlined step definitions and processing
  • Improved error handling strategies with centralized error messages and better flow processing logic

Enhanced Documentation

  • Completely revamped documentation with comprehensive guides and examples
  • Added detailed GoDoc comments across all core components for better API understanding
  • Created an LLM Developer Guide for AI-assisted development
  • Improved README with clearer examples and better organization

New Features

  • Added data registry for one-time data retrieval in callbacks, enabling complex data handling in button interactions
  • Implemented advanced examples including a complete Blackjack game demonstrating media handling and complex flows
  • Enhanced basic flow examples with media and menu commands

Architecture Improvements

  • Simplified bot architecture and flow management for better maintainability
  • Reduced cognitive complexity of flow and integration tests with helper functions
  • Improved keyboard management with better inline keyboard handling

📚 Documentation Updates

New Documentation Files

  • docs/teleflow_architecture.md - Detailed system architecture and design patterns
  • docs/llm_teleflow_guide.md - Comprehensive guide for understanding core concepts and usage patterns
  • docs/godoc_summary.md - Complete API documentation summary with examples

Improved Examples

  • example/blackjack/blackjack.go - Complete Blackjack game implementation showcasing advanced features
  • example/data-callbacks/data-callbacks.go - Demonstration of handling large callback data
  • example/basic-flow/basic-flow.go - Enhanced basic flow with media and menu commands

🔧 Technical Improvements

Flow System

  • Enhanced flow processing with better state management
  • Improved error handling with OnErrorCancel, OnErrorRetry, and OnErrorIgnore functions
  • Streamlined flow step definitions and processing logic

Keyboard Management

  • Improved inline keyboard builder with UUID mappings and complex callback data support
  • Better keyboard creation with ReplyKeyboard and ReplyKeyboardBuilder
  • Enhanced message/keyboard cleanup strategies

Template System

  • Enhanced template management functions with better integrity validation
  • Improved parse mode checks and template registration

Middleware System

  • Refined middleware documentation to clarify usage patterns and examples
  • Improved access manager integration for better authorization handling

🚀 Getting Started

With these improvements, getting started with Teleflow is easier than ever:

import teleflow "github.com/kslamph/teleflow/core"

// Basic initialization
bot, err := teleflow.NewBot(os.Getenv("TELEGRAM_BOT_TOKEN"))
if err != nil {
    log.Fatal(err)
}

// Simple message handler
bot.Router().Handle("start", teleflow.Func(func(ctx *teleflow.Context) error {
    return ctx.ReplyText("Welcome to Teleflow!")
}))

bot.Start()

📈 Migration Notes

This release includes breaking changes to the API. Please review the updated documentation and examples for migration guidance.

🙏 Acknowledgements

Thank you to all contributors who helped make this release possible. Your feedback and contributions continue to drive the improvement of Teleflow.