Araeynn commited on
Commit
1cf7548
1 Parent(s): 48218d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -14,12 +14,14 @@ from huggingface_hub import InferenceClient, login
14
  import time
15
  import os
16
 
 
17
  ph = st.empty()
18
 
19
  async def syncMessages():
20
  print(os.listdir(f"data"))
21
  if os.listdir("data") == []:
22
  return 0
 
23
  with ph.container():
24
  dirs = st.tabs(os.listdir("data"))
25
  i = -1
@@ -112,9 +114,12 @@ async def presence():
112
 
113
  @client.event
114
  async def on_message(message):
115
- await syncMessages()
116
  if clone:
 
 
117
  return 0
 
 
118
  for user in message.mentions:
119
  message.content = message.content.replace(f"<@{user.id}>",
120
  f"@{str(user)}")
 
14
  import time
15
  import os
16
 
17
+
18
  ph = st.empty()
19
 
20
  async def syncMessages():
21
  print(os.listdir(f"data"))
22
  if os.listdir("data") == []:
23
  return 0
24
+ ph.empty()
25
  with ph.container():
26
  dirs = st.tabs(os.listdir("data"))
27
  i = -1
 
114
 
115
  @client.event
116
  async def on_message(message):
 
117
  if clone:
118
+ asyncio.sleep(1)
119
+ await syncMessages()
120
  return 0
121
+ else:
122
+ await syncMessages()
123
  for user in message.mentions:
124
  message.content = message.content.replace(f"<@{user.id}>",
125
  f"@{str(user)}")