2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-24 19:07:17 +00:00

24 lines
577 B
JavaScript
Raw Normal View History

2017-09-24 18:05:16 +02:00
'use strict';
// Utils
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 22:29:40 +03:30
admins.sort((a, b) => a.first_name > b.first_name ? 1 : -1);
2017-09-24 18:05:16 +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,
disable_web_page_preview: true,
}).then(scheduleDeletion);
2017-09-24 18:05:16 +02:00
};
module.exports = staffHandler;