feat: add warnings for blocked telegram channels (#5439)
This commit is contained in:
parent
49aa77d360
commit
3fbf70ad43
|
|
@ -10,12 +10,17 @@ module.exports = async (ctx) => {
|
|||
const $ = cheerio.load(data);
|
||||
const list = $('.tgme_widget_message_wrap');
|
||||
|
||||
if (list.length === 0 && $('.tgme_channel_history').length === 0) {
|
||||
throw `Unable to fetch message feed from this channel. Please check this URL to see if you can view the message preview: https://t.me/s/${username}`;
|
||||
}
|
||||
|
||||
const feedTitle = searchQuery ? `「${searchQuery}」- ` + $('.tgme_channel_info_header_title').text() + ' - Telegram 频道' : $('.tgme_channel_info_header_title').text() + ' - Telegram 频道';
|
||||
|
||||
ctx.state.data = {
|
||||
title: feedTitle,
|
||||
description: $('.tgme_channel_info_description').text(),
|
||||
link: resourceUrl,
|
||||
allowEmpty: true,
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
|
|
|
|||
Loading…
Reference in New Issue