2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-31 06:05:22 +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:
GingerPlusPlus
2017-10-22 17:33:21 +02:00
parent 0d52ff3e76
commit b0075f2065
2 changed files with 10 additions and 3 deletions

View File

@@ -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,
};