Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ENT Marks Checker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maxime POULAIN
ENT Marks Checker
Commits
a8db29a7
Commit
a8db29a7
authored
1 year ago
by
Maxime POULAIN
Browse files
Options
Downloads
Patches
Plain Diff
bot more reliable
parent
d0d9b88c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Bot/bot.py
+2
-9
2 additions, 9 deletions
Bot/bot.py
Cypress/cypress.config.ts
+1
-0
1 addition, 0 deletions
Cypress/cypress.config.ts
with
3 additions
and
9 deletions
Bot/bot.py
+
2
−
9
View file @
a8db29a7
...
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Cypress/cypress.config.ts
+
1
−
0
View file @
a8db29a7
...
...
@@ -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
:
""
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment