Commit 59745434 authored by Guillaume Vagner's avatar Guillaume Vagner
Browse files

fix error

parent 1102f224
require('./telegram');
// Modules propres
var bot = require('./telegram');
require('./website');
var { getSchedules } = require('./connection-db');
var { addSchedule } = require('./schedule');
// Reboot proof : au démarrage de l'application, recréaction des rappels
getSchedules().then(chans => {
chans.forEach(chan => {
addSchedule(chan, chan.schedule, bot)
})
console.log(`[schdles] reload schedules`)
})
......@@ -4,20 +4,12 @@ var schedule = require('node-schedule');
// Modules propres
var { modifyChan, getGroups, getSchedules } = require('./connection-db');
var { getBirthdays, getNewToken } = require('./requests');
var bot = require('./telegram');
// Création de variables
var schedules = {};
getSchedules().then(chans => {
chans.forEach(chan => {
addSchedule(chan, chan.schedule)
})
console.log(`[schdles] reload schedules`)
})
function addSchedule(chan, time) {
function addSchedule(chan, time, bot) {
const hour = parseInt(time.split(':')[0]);
const minute = parseInt(time.split(':')[1]);
chan.schedule = time;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment