Skip to content

Commit

Permalink
fix: clearing clan settings when a new clan invitation token is created
Browse files Browse the repository at this point in the history
  • Loading branch information
motzel committed Jun 17, 2024
1 parent 7b1215e commit 089d54c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bl-bot"
version = "0.18.12"
version = "0.18.13"
description = "Beat Leader Discord Bot"
readme = "README.md"
repository = "https://github.com/motzel/bl-bot"
Expand Down
18 changes: 11 additions & 7 deletions src/discord/bot/commands/clan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,17 @@ pub(crate) async fn cmd_set_clan_invitation(

let player_clan = player_clan.unwrap();

let clan_settings = ClanSettings::new(
current_user.id,
player_clan.leader_id.clone(),
player_clan.id,
player_clan.tag.clone(),
self_invite,
);
let mut clan_settings = guild_settings
.clan_settings
.clone()
.unwrap_or(ClanSettings::new(
current_user.id,
player_clan.leader_id.clone(),
player_clan.id,
player_clan.tag.clone(),
self_invite,
));
clan_settings.set_oauth_token(false);

if ctx
.data()
Expand Down

0 comments on commit 089d54c

Please sign in to comment.