Skip to content

Commit

Permalink
Check existing application_id of Http when creating a Client (#…
Browse files Browse the repository at this point in the history
…1367)

With the `unstable_discord_api` feature enabled and when using `ClientBuilder::new_with_http`, this requires `application_id` to be provided *only* to `HttpBuilder` instead of both.  This prevents creating a second Http client that replaces the one provided with `ClientBuilder::new_with_http`.
  • Loading branch information
drklee3 committed May 30, 2021
1 parent 22d2276 commit 1744883
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/mod.rs
Expand Up @@ -338,9 +338,9 @@ impl<'a> Future for ClientBuilder<'a> {
let http = Arc::new(self.http.take().unwrap());

#[cfg(feature = "unstable_discord_api")]
self.application_id.expect(
"Please provide an Application Id in order to use slash commands features.",
);
if http.application_id == 0 {
panic!("Please provide an Application Id in order to use interactions features.");
}

#[cfg(feature = "voice")]
let voice_manager = self.voice_manager.take();
Expand Down

0 comments on commit 1744883

Please sign in to comment.