Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored verbose code constructs and QoL improvements #1326

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from

Conversation

Cespito
Copy link

@Cespito Cespito commented Feb 25, 2024

Summary
This pull request makes the following improvements:

  • Refactor verbose code constructs
  • Fix raw use of parameterized class
  • Fix redundant type cast
  • Add integrety check and small improvements in testing
  • Refactor package name
  • Delete unnecessary import
  • Fix MD list items numbering

Details

  • Added lambda expressions and utilized library methods to reduce code verbosity
  • Such raw use of generic types is valid in Java, but it defeats the purpose of type parameters and may mask bugs
  • Removed unnecessary cast expressions
  • Added integrety check in SilentSenderTest.java, and replaced in all tests the assertTrue method with check on instanceof with the respective assertInstanceOf library method
  • Refactored the org.telegram.telegrambots.test.Fakes package to match the convention. Package names are written in all lower case to avoid conflict with the names of classes or interfaces
  • Removed import lombok.extern.jackson.Jacksonized from AnswerInlineQuery.java class as it is not used
  • Small fixes on MD files for incorrect numbering in lists

Benefits
Improved code organization, maintainability, and readability.
Reduced redundancy and enhanced robustness of the code.

aNNiMON and others added 18 commits January 22, 2024 20:10
A semicolon were missing in the Standalone reply code.
The reply signature changed and needs a BiConsumer<BaseAbilityBot, Update> instead of Consumer<Update> in the Ability reply
…ed from 'Boolean' to 'String' (according to TelegramBotAPI Official Documentation). (rubenlagus#1315)
* fix force=true for WriteAccessAllowed

* + test and fixtures on write access allowed
* Fix path for GetMyName method

* Add missing sticker methods from API 6.6

* Fix possible NPE in InputSticker validation

* Add ReplyParameters to SendInvoice API method

* Removed mysterious fields in SetChatTitle
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.

None yet

9 participants