Araeynn commited on
Commit
99ae413
1 Parent(s): 32488a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -378,6 +378,23 @@ async def on_message(message):
378
  bannedUsers = json.loads(info)["bannedUsers"]
379
  imageModel = json.loads(info)["imageModel"]
380
  userTimes = json.loads(info)["userTimes"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  s = f":green[{message.author}]: :violet[{message.content}] :blue[{msgchannel_name}] :orange[{guild_name}]"
382
  if message.author == client.user:
383
  return
@@ -456,23 +473,6 @@ async def on_message(message):
456
  context = f.read()
457
  with open(f"{guild_name}.guild", "r") as f:
458
  o = f.read()
459
- try:
460
- with open(f"usrtime/{message.author}", "r") as f:
461
- er = f.read()
462
- except:
463
- with open(f"usrtime/{message.author}", "w") as f:
464
- f.write(str(round(time.time())))
465
- er = 0
466
- y = round(time.time()) - int(er)
467
- print(y)
468
- if str(message.author).lower() not in userTimes.keys():
469
- usrTime = 5
470
- else:
471
- usrTime = userTimes[str(message.author).lower()]
472
- if message.author.id in bannedUsers:
473
- return 0
474
- if y < usrTime:
475
- return 0
476
  if (str(message.channel.id) in o.split("\n")) or (guild_name == "Direct"):
477
  with open(f"usrtime/{message.author}", "w") as f:
478
  f.write(str(round(time.time())))
 
378
  bannedUsers = json.loads(info)["bannedUsers"]
379
  imageModel = json.loads(info)["imageModel"]
380
  userTimes = json.loads(info)["userTimes"]
381
+ try:
382
+ with open(f"usrtime/{message.author}", "r") as f:
383
+ er = f.read()
384
+ except:
385
+ with open(f"usrtime/{message.author}", "w") as f:
386
+ f.write(str(round(time.time())))
387
+ er = 0
388
+ y = round(time.time()) - int(er)
389
+ print(y)
390
+ if str(message.author).lower() not in userTimes.keys():
391
+ usrTime = 5
392
+ else:
393
+ usrTime = userTimes[str(message.author).lower()]
394
+ if message.author.id in bannedUsers:
395
+ return 0
396
+ if y < usrTime:
397
+ return 0
398
  s = f":green[{message.author}]: :violet[{message.content}] :blue[{msgchannel_name}] :orange[{guild_name}]"
399
  if message.author == client.user:
400
  return
 
473
  context = f.read()
474
  with open(f"{guild_name}.guild", "r") as f:
475
  o = f.read()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
476
  if (str(message.channel.id) in o.split("\n")) or (guild_name == "Direct"):
477
  with open(f"usrtime/{message.author}", "w") as f:
478
  f.write(str(round(time.time())))