From 9ec7f92a4c96bce7a8840516dd62217714438b35 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 29 Mar 2023 14:05:48 +0200 Subject: [PATCH] fix coin debt exploit --- coin.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coin.rb b/coin.rb index 1ec6fcb..2a81365 100644 --- a/coin.rb +++ b/coin.rb @@ -102,6 +102,10 @@ def give_coin(event) coin_amount = 5 end + if reactor_coins < coin_amount + coin_amount = reactor_coins + end + increment_coin(event.message.author.id, coin_amount) increment_coin(event.user.id, -coin_amount)