Skip to content

Commit

Permalink
telegraph is now default fill illust title/ url / author_name
Browse files Browse the repository at this point in the history
  • Loading branch information
makeding committed Jul 15, 2024
1 parent e6d53f4 commit d369350
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,16 @@ async function tg_sender(ctx) {
}
if (mgs.length > 0) {
if (ctx.us.telegraph) {
// when not have title provided and 1 illust only
if(!ctx.us.telegraph_title && illusts.length === 1) {
ctx.us.telegraph_title = illusts[0].title
if(!ctx.us.telegraph_author_name){
ctx.us.telegraph_author_name = illusts[0].author_name
ctx.us.telegraph_author_url = `https://www.pixiv.net/artworks/${illusts[0].id}`
}
}
try {
bot.api.sendChatAction(chat_id, 'typing')
await bot.api.sendChatAction(chat_id, 'typing').catch()
let res_data = await mg2telegraph(mgs[0], ctx.us.telegraph_title, user_id, ctx.us.telegraph_author_name, ctx.us.telegraph_author_url)
if (res_data) {
await asyncForEach(res_data, async (d) => {
Expand Down

0 comments on commit d369350

Please sign in to comment.