2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-09-05 08:35:22 +00:00

Handle and utilize message links

This commit is contained in:
GingerPlusPlus
2019-04-06 15:39:40 +02:00
parent 5bbdb529f1
commit 5b9cea8103
3 changed files with 14 additions and 2 deletions

View File

@@ -15,6 +15,9 @@ const isCommand = R.pipe(
const escapeHtml = s => s
.replace(/</g, '&lt;');
const msgLink = msg =>
`https://t.me/c/${msg.chat.id.toString().slice(4)}/${msg.message_id}`;
const link = ({ id, first_name }) =>
`<a href="tg://user?id=${id}">${escapeHtml(first_name)}</a>`;
@@ -57,6 +60,7 @@ module.exports = {
escapeHtml,
isCommand,
link,
msgLink,
quietLink,
scheduleDeletion,
};