diff --git a/web/Cargo.lock b/web/Cargo.lock index 786ebe5..5b186b6 100644 --- a/web/Cargo.lock +++ b/web/Cargo.lock @@ -2936,7 +2936,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waitingway-web" -version = "2.1.3" +version = "2.1.4" dependencies = [ "actix-cors", "actix-web", diff --git a/web/Cargo.toml b/web/Cargo.toml index d73ac2e..ac28fed 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -3,7 +3,7 @@ name = "waitingway-web" authors = ["Asriel Camora "] description = "Backend web server for Waitingway" repository = "https://github.com/WorkingRobot/Waitingway" -version = "2.1.3" +version = "2.1.4" edition = "2021" [dependencies] diff --git a/web/src/discord.rs b/web/src/discord.rs index d07f43d..95f9c1b 100644 --- a/web/src/discord.rs +++ b/web/src/discord.rs @@ -169,6 +169,8 @@ impl DiscordClient { access_token: String, ) -> Result { log::info!("Onboarding user {}", user_id); + + let already_in_guild = match self.config().guild_id.member(self.http(), user_id).await { Ok(_) => true, Err(serenity::Error::Http(HttpError::UnsuccessfulRequest(ErrorResponse { error: DiscordJsonError { code: 10007, .. }, // Unknown Member