Araeynn commited on
Commit
5fe6faa
·
verified ·
1 Parent(s): c804e1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -372,6 +372,7 @@ async def on_message(message):
372
  info = requests.get("https://raw.githubusercontent.com/aryananumula/lr/main/info.json").content
373
  bannedUsers = json.loads(info)["bannedUsers"]
374
  imageModel = json.loads(info)["imageModel"]
 
375
  s = f":green[{message.author}]: :violet[{message.content}] :blue[{msgchannel_name}] :orange[{guild_name}]"
376
  if message.author == client.user:
377
  return
@@ -459,9 +460,16 @@ async def on_message(message):
459
  er = 0
460
  y = round(time.time()) - int(er)
461
  print(y)
 
 
 
 
 
 
 
 
 
462
  if (str(message.channel.id) in o.split("\n")) or (guild_name == "Direct"):
463
- if y < 5:
464
- return 0
465
  with open(f"usrtime/{message.author}", "w") as f:
466
  f.write(str(round(time.time())))
467
  async with msgchannel.typing():
 
372
  info = requests.get("https://raw.githubusercontent.com/aryananumula/lr/main/info.json").content
373
  bannedUsers = json.loads(info)["bannedUsers"]
374
  imageModel = json.loads(info)["imageModel"]
375
+ userTimes = json.loads(info)["userTimes"]
376
  s = f":green[{message.author}]: :violet[{message.content}] :blue[{msgchannel_name}] :orange[{guild_name}]"
377
  if message.author == client.user:
378
  return
 
460
  er = 0
461
  y = round(time.time()) - int(er)
462
  print(y)
463
+ userTimes = list(map(lambda x: x.lower(), userTimes.keys))
464
+ if str(user).lower() not in userTimes:
465
+ usrTime = 5
466
+ else:
467
+ usrTime = userTimes[str(user).lower()]
468
+ if user.id in bannedUsers:
469
+ return 0
470
+ if y < usrTime:
471
+ return 0
472
  if (str(message.channel.id) in o.split("\n")) or (guild_name == "Direct"):
 
 
473
  with open(f"usrtime/{message.author}", "w") as f:
474
  f.write(str(round(time.time())))
475
  async with msgchannel.typing():