Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Synced repo using 'sync_with_huggingface' Github Action
Browse files
app.py
CHANGED
@@ -91,23 +91,17 @@ async def on_message(message):
|
|
91 |
string_member_id = str(message.author.id)
|
92 |
xp = 10
|
93 |
new_level = calculate_level(xp)
|
94 |
-
print(string_member_id)
|
95 |
-
print(message.author.name)
|
96 |
-
print(xp)
|
97 |
-
print(new_level)
|
98 |
-
|
99 |
message_author_name = message.author.name
|
100 |
worksheet.update(values=[[string_member_id, message_author_name, xp, new_level]], range_name=f'A{length+1}:D{length+1}')
|
101 |
else:
|
102 |
if cell:
|
103 |
-
print(f"updating record for {message.author}")
|
104 |
# if so, update that row...
|
105 |
# update exp, can only be in a positive direction
|
106 |
# read
|
107 |
xp = worksheet.cell(cell.row, cell.col+2).value
|
108 |
xp = int(xp) + XP_PER_MESSAGE
|
109 |
current_level = calculate_level(xp)
|
110 |
-
print(
|
111 |
# write with added xp
|
112 |
worksheet.update(values=[[xp, current_level]], range_name=f'C{cell.row}:D{cell.row}')
|
113 |
if current_level == 2:
|
|
|
91 |
string_member_id = str(message.author.id)
|
92 |
xp = 10
|
93 |
new_level = calculate_level(xp)
|
|
|
|
|
|
|
|
|
|
|
94 |
message_author_name = message.author.name
|
95 |
worksheet.update(values=[[string_member_id, message_author_name, xp, new_level]], range_name=f'A{length+1}:D{length+1}')
|
96 |
else:
|
97 |
if cell:
|
|
|
98 |
# if so, update that row...
|
99 |
# update exp, can only be in a positive direction
|
100 |
# read
|
101 |
xp = worksheet.cell(cell.row, cell.col+2).value
|
102 |
xp = int(xp) + XP_PER_MESSAGE
|
103 |
current_level = calculate_level(xp)
|
104 |
+
print(f"updating record for {message.author}: {xp} xp")
|
105 |
# write with added xp
|
106 |
worksheet.update(values=[[xp, current_level]], range_name=f'C{cell.row}:D{cell.row}')
|
107 |
if current_level == 2:
|