Skip to content

Commit 25b9777

Browse files
fix;cannot update a fetched selector
1 parent bed6300 commit 25b9777

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bot.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ async def contribution(ctx, name, task):
295295
if data != None:
296296
for key, value in data.items():
297297
if value["Name"].casefold() == name.casefold():
298-
selector = leaderboard_ref.child(key).get()
299-
298+
selector = leaderboard_ref.child(key)
299+
ref = selector.get()
300300
points_dict = {
301301
"pull request": 20,
302302
"info": 40,
@@ -320,8 +320,8 @@ async def contribution(ctx, name, task):
320320
"promotion large": 50,
321321
}
322322

323-
rating = selector["Rating"] + points_dict[task.casefold()]
324-
contributions = selector["Contributions"] + 1
323+
rating = ref["Rating"] + points_dict[task.casefold()]
324+
contributions = ref["Contributions"] + 1
325325

326326
selector.update(
327327
{

0 commit comments

Comments
 (0)