Skip to content

Commit 3f71f7c

Browse files
committed
Prevent users from changing their own social credit
1 parent bc07dfe commit 3f71f7c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/discord_bot/social_credit.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ pub(crate) async fn run(
5858
return Ok(());
5959
};
6060

61+
if who == message.author.id {
62+
message
63+
.reply(
64+
&ctx,
65+
"You cannot change your own social credit. That's cheating!",
66+
)
67+
.await?;
68+
return Ok(());
69+
}
70+
6171
let mut storage = GuildStorage::get_mut(guild_id).await;
6272
let social_credit = storage.social_credit.entry(who).or_default();
6373
let new_social_credit = social_credit.wrapping_add(amount);

0 commit comments

Comments
 (0)