mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-09-03 07:35:17 +00:00
Used new quietLink instead of link in /staff
1. It doesn't mention admins 2. It's more reliable (inline mentiones sometimes don't work)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// Utils
|
||||
const { link } = require('../../utils/tg');
|
||||
const { quietLink } = require('../../utils/tg');
|
||||
|
||||
// DB
|
||||
const { getAdmins } = require('../../stores/user');
|
||||
@@ -9,12 +9,13 @@ const { getAdmins } = require('../../stores/user');
|
||||
const staffHandler = async ctx => {
|
||||
const admins = await getAdmins();
|
||||
|
||||
const links = admins.map(link);
|
||||
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,
|
||||
});
|
||||
};
|
||||
|
||||
|
@@ -6,6 +6,11 @@ const escapeHtml = s => s
|
||||
const link = ({ id, first_name }) =>
|
||||
`<a href="tg://user?id=${id}">${escapeHtml(first_name)}</a>`;
|
||||
|
||||
const quietLink = (user) =>
|
||||
user.username
|
||||
? `<a href="t.me/${user.username}">${escapeHtml(user.first_name)}</a>`
|
||||
: link(user);
|
||||
|
||||
/**
|
||||
* @param {number} ms
|
||||
* Deletes messages after (ms) milliseconds
|
||||
@@ -19,5 +24,6 @@ const deleteAfter = ms => ctx =>
|
||||
module.exports = {
|
||||
deleteAfter,
|
||||
escapeHtml,
|
||||
link
|
||||
link,
|
||||
quietLink,
|
||||
};
|
||||
|
Reference in New Issue
Block a user