Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
happy-botday
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
Container registry
Model registry
Operate
Environments
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
Guillaume Vagner
happy-botday
Commits
3e95b671
Commit
3e95b671
authored
6 years ago
by
Guillaume Vagner
Browse files
Options
Downloads
Patches
Plain Diff
retroactive schedule
parent
59745434
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
schedule.js
+6
-6
6 additions, 6 deletions
schedule.js
with
6 additions
and
6 deletions
schedule.js
+
6
−
6
View file @
3e95b671
...
...
@@ -13,14 +13,14 @@ function addSchedule(chan, time, bot) {
const
hour
=
parseInt
(
time
.
split
(
'
:
'
)[
0
]);
const
minute
=
parseInt
(
time
.
split
(
'
:
'
)[
1
]);
chan
.
schedule
=
time
;
return
Promise
.
all
([
modifyChan
(
chan
),
getGroups
(
chan
.
chatId
)
]).
then
(([
chan
,
groups
])
=>
{
return
modifyChan
(
chan
).
then
(
chan
=>
{
schedules
[
chan
.
chatId
]
=
schedule
.
scheduleJob
({
hour
:
hour
,
minute
:
minute
},
function
()
{
return
getNewToken
(
chan
).
then
(
chan
=>
{
return
getBirthdays
(
chan
.
token
)
}).
then
(
users
=>
{
return
Promise
.
all
([
getBirthdays
(
chan
.
token
),
getGroups
(
chan
.
chatId
)
])
}).
then
(([
users
,
groups
])
=>
{
// récupère que les personnes du jour qui font partie des groupes ciblés
const
newUsers
=
users
.
filter
(
user
=>
user
.
asso
.
some
(
asso
=>
groups
.
indexOf
(
asso
)
!==
-
1
));
if
(
newUsers
.
length
===
0
)
return
...
...
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