Skip to content
Snippets Groups Projects
Commit a8db29a7 authored by Maxime POULAIN's avatar Maxime POULAIN
Browse files

bot more reliable

parent d0d9b88c
No related branches found
No related tags found
No related merge requests found
......@@ -131,11 +131,7 @@ async def send_marks(author, send):
with open(f"volume/marks/{discord}.json", "r") as f:
marks = json.load(f)
try:
output = subprocess.call(f'npm --prefix ../Cypress/ run run -- --env username={username},password="{password}",discord={discord}',shell=True)
except:
await send("Une erreur est survenue !")
return
output = subprocess.call(f'npm --prefix ../Cypress/ run run -- --env username={username},password="{password}",discord={discord}',shell=True)
if output == 0:
with open(f"volume/marks/{discord}.json", "r", encoding = "utf-8") as f:
......@@ -148,9 +144,6 @@ async def send_marks(author, send):
if element not in marks:
await send(f"{element['lesson']} : {element['mark']}")
else:
await send("Une erreur est survenue, une erreur de mot de passe ?")
@bot.event
async def on_ready():
print(f"Logged in as {bot.user.name}")
......@@ -163,7 +156,7 @@ async def on_ready():
if discord_user is not None:
await send_marks(f"{data[0]}#{data[1]}", discord_user.send)
await asyncio.sleep(60 * 15)
await asyncio.sleep(60 * 60)
bot.run(token)
......@@ -6,6 +6,7 @@ export default defineConfig({
},
specPattern: "**/e2e/*.ts",
video: false,
defaultCommandTimeout: 30000,
env: {
baseUrl: "https://ent.uca.fr/cas/login?service=https%3A%2F%2Fent.uca.fr%2Fcore%2Fhome",
username: "",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment