We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b276b54 commit 87f971fCopy full SHA for 87f971f
1 file changed
bot/exts/levels/_cog.py
@@ -196,12 +196,11 @@ async def _refresh_sorted_thresholds(self) -> None:
196
async def _update_points(self, user_id: int, points: int, halve_points: bool=False) -> None:
197
"""Updates user's score and ensures correct role is assigned."""
198
logger.debug(f"User {user_id} getting {points} points, halving override: {halve_points}.")
199
- if points == 0 and not halve_points:
200
- return
201
-
202
if not await self.user_points_cache.contains(user_id):
203
await self.user_points_cache.set(user_id, points)
204
else:
+ if points == 0 and not halve_points:
+ return
205
current_points = cast(int, await self.user_points_cache.get(user_id, default=0))
206
new_point_total = current_points + points
207
if halve_points:
0 commit comments