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

Allow users to reuse Http when building the Client #1189

Merged
merged 2 commits into from
Jan 17, 2021

Conversation

arqunis
Copy link
Member

@arqunis arqunis commented Jan 16, 2021

This adds a new construction method to the ClientBuilder, new_with_http, that will allow users to reuse their instances of the Http client.

This can be useful in the case when a user creates a Http instance to retrieve their bot's user id for the Configuration::on_mention method, and then wish to pass that instance to the ClientBuilder to bypass unnecessary creation of a second Http instance.

@arqunis arqunis added enhancement An improvement to Serenity. client Related to the `client` module. labels Jan 16, 2021
@arqunis arqunis merged commit 0e2b648 into serenity-rs:current Jan 17, 2021
@arqunis arqunis deleted the with_http branch January 17, 2021 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Related to the `client` module. enhancement An improvement to Serenity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant