Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
longer sleeps
Browse files
app.py
CHANGED
@@ -73,11 +73,11 @@ async def give_verified_roles():
|
|
73 |
global_df = pd.read_csv(io.StringIO(csv_data))
|
74 |
except asyncio.TimeoutError:
|
75 |
print("CSV fetch timed out.")
|
76 |
-
await asyncio.sleep(
|
77 |
continue
|
78 |
except Exception as e:
|
79 |
print(f"Error fetching CSV: {e}")
|
80 |
-
await asyncio.sleep(
|
81 |
continue
|
82 |
|
83 |
guild = bot.get_guild(879548962464493619)
|
@@ -102,21 +102,22 @@ async def give_verified_roles():
|
|
102 |
continue
|
103 |
if role not in member.roles:
|
104 |
await member.add_roles(role)
|
|
|
105 |
print(f"Role added to member: {member}")
|
106 |
-
await asyncio.sleep(
|
107 |
lunar = bot.get_user(811235357663297546)
|
108 |
if lunar:
|
109 |
await lunar.send(f"Verified role given to {member}!")
|
110 |
-
await asyncio.sleep(
|
111 |
await member.send(
|
112 |
f"Verification successful! [{member} <---> {row['discord_user_name']}] \n🤗 {org_link} {invite_message}"
|
113 |
)
|
114 |
-
await asyncio.sleep(
|
115 |
|
116 |
except Exception as e:
|
117 |
print(f"Error encountered: {e}")
|
118 |
|
119 |
-
await asyncio.sleep(
|
120 |
|
121 |
|
122 |
# runs discord bot in thread = helps avoid blocking calls
|
|
|
73 |
global_df = pd.read_csv(io.StringIO(csv_data))
|
74 |
except asyncio.TimeoutError:
|
75 |
print("CSV fetch timed out.")
|
76 |
+
await asyncio.sleep(60)
|
77 |
continue
|
78 |
except Exception as e:
|
79 |
print(f"Error fetching CSV: {e}")
|
80 |
+
await asyncio.sleep(60)
|
81 |
continue
|
82 |
|
83 |
guild = bot.get_guild(879548962464493619)
|
|
|
102 |
continue
|
103 |
if role not in member.roles:
|
104 |
await member.add_roles(role)
|
105 |
+
await asyncio.sleep(10)
|
106 |
print(f"Role added to member: {member}")
|
107 |
+
await asyncio.sleep(10)
|
108 |
lunar = bot.get_user(811235357663297546)
|
109 |
if lunar:
|
110 |
await lunar.send(f"Verified role given to {member}!")
|
111 |
+
await asyncio.sleep(10)
|
112 |
await member.send(
|
113 |
f"Verification successful! [{member} <---> {row['discord_user_name']}] \n🤗 {org_link} {invite_message}"
|
114 |
)
|
115 |
+
await asyncio.sleep(10)
|
116 |
|
117 |
except Exception as e:
|
118 |
print(f"Error encountered: {e}")
|
119 |
|
120 |
+
await asyncio.sleep(60)
|
121 |
|
122 |
|
123 |
# runs discord bot in thread = helps avoid blocking calls
|