Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
async def update_sheet(ctx):
Browse files
app.py
CHANGED
@@ -38,8 +38,6 @@ async def on_ready():
|
|
38 |
|
39 |
|
40 |
|
41 |
-
|
42 |
-
|
43 |
def calculate_level(xp):
|
44 |
return int(xp ** (1.0 / 3.0))
|
45 |
|
@@ -108,6 +106,25 @@ async def add_exp(member):
|
|
108 |
print(f"add_exp Error: {e}")
|
109 |
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
@bot.event
|
112 |
async def on_message(message):
|
113 |
try:
|
|
|
38 |
|
39 |
|
40 |
|
|
|
|
|
41 |
def calculate_level(xp):
|
42 |
return int(xp ** (1.0 / 3.0))
|
43 |
|
|
|
106 |
print(f"add_exp Error: {e}")
|
107 |
|
108 |
|
109 |
+
@bot.command
|
110 |
+
async def update_sheet(ctx):
|
111 |
+
if ctx.author.id == 811235357663297546:
|
112 |
+
guild = bot.get_guild(879548962464493619)
|
113 |
+
#hf_discord_verified_users_test = gspread_bot.open("hf_discord_verified_users_test").sheet1
|
114 |
+
worksheet2 = gspread_bot.open("levelbot").sheet2
|
115 |
+
|
116 |
+
verified_role = guild.get_role(900063512829755413)
|
117 |
+
for member in verified_role.members:
|
118 |
+
string_user_id = str(member.id)
|
119 |
+
|
120 |
+
cell_list = worksheet2.findall(member.id, in_column=1)
|
121 |
+
|
122 |
+
for cell in cell_list:
|
123 |
+
row_number = cell.row
|
124 |
+
column_number_to_update = 5
|
125 |
+
worksheet2.update_cell(row_number, column_number_to_update, string_user_id)
|
126 |
+
|
127 |
+
|
128 |
@bot.event
|
129 |
async def on_message(message):
|
130 |
try:
|