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

Jetty HttpClient implementation of TelegramClient #1425

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

Conversation

valkuc
Copy link

@valkuc valkuc commented Sep 7, 2024

Hi.
In my project I'm using Jetty Server. I came to the conclusion that additional dependencies on OkHttp client and Kotlin - is too much. So I decided to create TelegramClient implementation that uses Jetty HttpClient instead of OkHttp.

To use it, just include

<dependency>
    <groupId>org.telegram</groupId>
    <artifactId>telegrambots-client-jetty-adapter</artifactId>
</dependency>

instead of

<dependency>
    <groupId>org.telegram</groupId>
    <artifactId>telegrambots-client</artifactId>
</dependency>

Some considerations:

  1. It would be nice to move OkHttp from telegrambots-client to separate dependency, for example telegrambots-client-okhttp-adapter.
  2. Move common client parts (like creation of request body) to abstract class.

@rubenlagus rubenlagus changed the base branch from master to dev September 7, 2024 17:01
@valkuc
Copy link
Author

valkuc commented Sep 11, 2024

@rubenlagus Hi. Any troubles with merging?

@rubenlagus
Copy link
Owner

Hi @valkuc , no concerns but can you add one lesson for this client as well here: https://github.com/rubenlagus/TelegramBotsDocumentation

@valkuc
Copy link
Author

valkuc commented Nov 25, 2024

Hi @valkuc , no concerns but can you add one lesson for this client as well here: https://github.com/rubenlagus/TelegramBotsDocumentation

Hi. Yep, will do.

@Chase22
Copy link
Collaborator

Chase22 commented Nov 25, 2024

Move common client parts (like creation of request body) to abstract class.

I did actually consider this when making the telegram client, unfortunately there's no unified interface for multipart requests. It's something we'd have to implement ourselves

@valkuc
Copy link
Author

valkuc commented Nov 26, 2024

Hi @valkuc , no concerns but can you add one lesson for this client as well here: https://github.com/rubenlagus/TelegramBotsDocumentation

Hi. Yep, will do.

@rubenlagus maybe I'm blind but I don't see my changes in master. Looks like something goes wrong with merge.

@rubenlagus
Copy link
Owner

Hi @valkuc , no concerns but can you add one lesson for this client as well here: https://github.com/rubenlagus/TelegramBotsDocumentation

Hi. Yep, will do.

@rubenlagus maybe I'm blind but I don't see my changes in master. Looks like something goes wrong with merge.

I'll merge it when I have a bit of time, there are some extra fields that need to be added to the media classes

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.

3 participants