lunarflu HF staff commited on
Commit
4d17bea
1 Parent(s): 20630d7
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -156,8 +156,10 @@ async def check(ctx):
156
 
157
  async def add_exp(member_id):
158
  try:
 
159
  guild = bot.get_guild(879548962464493619)
160
  member = guild.get_member(member_id)
 
161
  lvl1 = guild.get_role(1171861537699397733)
162
  lvl2 = guild.get_role(1171861595115245699)
163
  lvl3 = guild.get_role(1171861626715115591)
@@ -182,10 +184,12 @@ async def add_exp(member_id):
182
  1: lvl1, 2: lvl2, 3: lvl3, 4: lvl4, 5: lvl5, 6: lvl6, 7: lvl7, 8: lvl8, 9: lvl9, 10: lvl10,
183
  11: lvl11, 12: lvl12, 13: lvl13, 14: lvl14, 15: lvl15, 16: lvl16, 17: lvl17, 18: lvl18, 19: lvl19, 20: lvl20,
184
  }
 
185
  #if member.id == 811235357663297546:
186
  # does a record already exist?
187
  cell = worksheet.find(str(member.id))
188
  length = len(worksheet.col_values(1))
 
189
  if cell is None:
190
  print(f"creating new record for {member}")
191
  # if not, create new record
@@ -199,6 +203,7 @@ async def add_exp(member_id):
199
  if lvl1 not in member.roles:
200
  await member.add_roles(lvl1)
201
  print(f"Gave {member} {lvl1}")
 
202
  else:
203
  if cell:
204
  # if so, update that row...
@@ -228,6 +233,7 @@ async def add_exp(member_id):
228
  async def on_message(message):
229
  try:
230
  if message.author.id not in bot_ids:
 
231
  await add_exp(message.author.id)
232
  #await periodic_api_test() # run this ~1 per day otherwise will lead to issues
233
  await bot.process_commands(message)
 
156
 
157
  async def add_exp(member_id):
158
  try:
159
+ print(f"1")
160
  guild = bot.get_guild(879548962464493619)
161
  member = guild.get_member(member_id)
162
+ print(f" {member}")
163
  lvl1 = guild.get_role(1171861537699397733)
164
  lvl2 = guild.get_role(1171861595115245699)
165
  lvl3 = guild.get_role(1171861626715115591)
 
184
  1: lvl1, 2: lvl2, 3: lvl3, 4: lvl4, 5: lvl5, 6: lvl6, 7: lvl7, 8: lvl8, 9: lvl9, 10: lvl10,
185
  11: lvl11, 12: lvl12, 13: lvl13, 14: lvl14, 15: lvl15, 16: lvl16, 17: lvl17, 18: lvl18, 19: lvl19, 20: lvl20,
186
  }
187
+ print(f"2")
188
  #if member.id == 811235357663297546:
189
  # does a record already exist?
190
  cell = worksheet.find(str(member.id))
191
  length = len(worksheet.col_values(1))
192
+ print(f"3")
193
  if cell is None:
194
  print(f"creating new record for {member}")
195
  # if not, create new record
 
203
  if lvl1 not in member.roles:
204
  await member.add_roles(lvl1)
205
  print(f"Gave {member} {lvl1}")
206
+ print(f"4")
207
  else:
208
  if cell:
209
  # if so, update that row...
 
233
  async def on_message(message):
234
  try:
235
  if message.author.id not in bot_ids:
236
+ print(f"adding exp from message {message.author}")
237
  await add_exp(message.author.id)
238
  #await periodic_api_test() # run this ~1 per day otherwise will lead to issues
239
  await bot.process_commands(message)