DL
Size: a a a
DL
P
const CronJob = require('cron').CronJob;
const job = new CronJob('*/5 * * * * *', async function() {
const user = await db.User.findOne();
await bot.telegram.sendMessage(user.chat_id, 'Hello World');
})
bot.command('launch', async (ctx) => {
job.start()
})
bot.command('stop', async (ctx) => {
job.stop();
})Ꮶ
const CronJob = require('cron').CronJob;
const job = new CronJob('*/5 * * * * *', async function() {
const user = await db.User.findOne();
await bot.telegram.sendMessage(user.chat_id, 'Hello World');
})
bot.command('launch', async (ctx) => {
job.start()
})
bot.command('stop', async (ctx) => {
job.stop();
})Ꮶ
Ꮶ
P
P
ctx, только не знаю, как его взять, потому что юзер напрямую не обращается, только при запуске скриптаconst user = await db.User.findOne({chat_id: ctx.chat.id});
await bot.telegram.sendMessage(user.chat_id, 'Hello World');Ꮶ
Ꮶ
y
createIndex({foo: 1, bar: 1}, partialIndexExpression: {foo: true})find({foo: true}).sort({bar: 1})m
Т

insertMany. документы создаются, но без индексов. одм mongooseТ
Т
DL
DL
Т
DL
DL
Т