feat: telegram channel, show attachment name in title (#6219)

This commit is contained in:
notofoe 2020-11-24 21:43:52 +08:00 committed by GitHub
parent d5ae44875c
commit f70f2f7412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -193,17 +193,19 @@ module.exports = async (ctx) => {
const messageTextObject = item.find('.tgme_widget_message_bubble > .tgme_widget_message_text');
let messageText = '',
messageTitle = '';
if (messageTextObject.length > 0) {
messageTitle = messageTextObject.text();
messageText = `<p>${messageTextObject.html()}</p>`;
}
if (pollQuestion !== '') {
messageTitle = pollQuestion;
} else if (attachmentTitle !== '') {
messageTitle = attachmentTitle;
} else if (messageTextObject.length > 0) {
messageTitle = messageTextObject.text();
} else {
if (pollQuestion !== '') {
messageTitle = pollQuestion;
} else if (attachmentTitle !== '') {
messageTitle = attachmentTitle;
} else {
messageTitle = pubDate;
}
messageTitle = pubDate;
}
return {