2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-23 18:38:05 +00:00

21 lines
491 B
JavaScript
Raw Normal View History

2017-10-02 12:09:44 +03:30
'use strict';
// Bot
const bot = require('../../bot');
2017-10-02 12:09:44 +03:30
// DB
const { managesGroup } = require('../../stores/group');
const linkHandler = async ({ chat, replyWithHTML }) => {
const group = await managesGroup({ id: chat.id });
2017-10-02 12:09:44 +03:30
const { message_id } = await replyWithHTML(
2017-10-02 12:09:44 +03:30
' <b>Group\'s link:</b>\n\n' +
`<a href="${group.link}">${group.title}</a>`
);
return setTimeout(() =>
bot.telegram.deleteMessage(chat.id, message_id), 5 * 60 * 1000);
2017-10-02 12:09:44 +03:30
};
module.exports = linkHandler;