2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-28 04:37:52 +00:00
Thomas Rory Gummerson 758b924436
Type ctx
2020-03-13 22:00:30 +01:00

25 lines
649 B
JavaScript

'use strict';
// Utils
const { quietLink, scheduleDeletion } = require('../../utils/tg');
// DB
const { getAdmins } = require('../../stores/user');
/** @param { import('../../typings/context').ExtendedContext } ctx */
const staffHandler = async ctx => {
const admins = await getAdmins();
admins.sort((a, b) => a.first_name > b.first_name ? 1 : -1);
const links = admins.map(quietLink);
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());
};
module.exports = staffHandler;