Skip to content

Comments

Added DSL, simplified polling logic, code cleanup#1

Open
lamba92 wants to merge 2 commits intoalllex:mainfrom
lamba92:main
Open

Added DSL, simplified polling logic, code cleanup#1
lamba92 wants to merge 2 commits intoalllex:mainfrom
lamba92:main

Conversation

@lamba92
Copy link

@lamba92 lamba92 commented Dec 26, 2023

Changes:

  • Most of the polling logic has been replaced with coroutine code.
  • Added TelegramBotUpdateBuilder DSL to build the bot
  • Exposed TelegramBotApiClient's properties to allows custom extension
  • Simplified TelegramBotApiClient's HttpClient defaults
  • Replaced sealed classes with sealed interfaces
  • Added logger and json to TelegramBotApiContext
  • Removed @OptIn annotations
  • Expanded star imports for code readability outside IDE
  • bump library versions
  • bump gradle wrapper version

kotlinx-serialization = "1.5.1"
ktor = "2.3.2"
log4j = "2.20.0"
kotlinTarget = "1.9.20"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Let's not bump the target version of Kotlin without an explicit reason.

I also updated the dependency versions in a separate PR (#2), so let's remove the version updates from this one

Changes:
- Most of the polling logic has been replaced with coroutine code.
- Added TelegramBotUpdateBuilder DSL to build the bot
- Exposed TelegramBotApiClient's properties to allows custom extension
- Simplified TelegramBotApiClient's HttpClient defaults
- Replaced sealed classes with sealed interfaces
- Added logger and json to TelegramBotApiContext
- Removed @OptIn annotations
- Expanded star imports for code readability outside IDE
- bump library versions
- bump gradle wrapper version
- `startPolling` now uses `supervisorScope` to allow parallel execution of updates
- better error logging when handling updates
- TelegramBotApiContext is now a class, no need to have an interface for 3 parameters
- dump new Kotlin APIs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants