2017-09-24 18:05:16 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// Utils
|
2017-10-31 22:20:49 +01:00
|
|
|
const { quietLink, scheduleDeletion } = require('../../utils/tg');
|
2017-09-24 18:05:16 +02:00
|
|
|
|
|
|
|
// DB
|
2017-09-27 00:11:20 +03:30
|
|
|
const { getAdmins } = require('../../stores/user');
|
2017-09-24 18:05:16 +02:00
|
|
|
|
|
|
|
const staffHandler = async ctx => {
|
2017-09-27 00:11:20 +03:30
|
|
|
const admins = await getAdmins();
|
2017-11-23 18:39:08 +03:30
|
|
|
admins.sort((a, b) => a.first_name > b.first_name);
|
2017-09-24 18:05:16 +02:00
|
|
|
|
2017-10-22 17:33:21 +02:00
|
|
|
const links = admins.map(quietLink);
|
2017-09-24 18:05:16 +02:00
|
|
|
|
|
|
|
const list = links.map(s => `⭐ ${s}`).join('\n');
|
|
|
|
|
|
|
|
return ctx.replyWithHTML(`<b>Admins in the network:</b>\n\n${list}`, {
|
|
|
|
disable_notification: true,
|
2017-10-22 17:33:21 +02:00
|
|
|
disable_web_page_preview: true,
|
2017-10-31 22:20:49 +01:00
|
|
|
}).then(scheduleDeletion);
|
2017-09-24 18:05:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = staffHandler;
|