2017-09-24 18:05:16 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// Utils
|
|
|
|
const { link } = require('../../utils/tg');
|
|
|
|
|
|
|
|
// 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-09-24 18:05:16 +02:00
|
|
|
|
|
|
|
const links = admins
|
|
|
|
// this first .map wouldn't have to be here
|
|
|
|
// if we stored whole user as-is
|
|
|
|
// ie. if id was available as id, not user_id
|
|
|
|
.map(admin => ({
|
|
|
|
first_name: admin.first_name,
|
|
|
|
id: admin.user_id,
|
|
|
|
}))
|
|
|
|
.map(link);
|
|
|
|
|
|
|
|
const list = links.map(s => `⭐ ${s}`).join('\n');
|
|
|
|
|
|
|
|
return ctx.replyWithHTML(`<b>Admins in the network:</b>\n\n${list}`, {
|
|
|
|
disable_notification: true,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = staffHandler;
|