From df8fa781aecadf1891e3c1863d5654d73847edeb Mon Sep 17 00:00:00 2001 From: pseudoyu Date: Mon, 28 Oct 2024 17:45:03 +0700 Subject: [PATCH] fix(route/telegram): null username from telegram api --- lib/routes/telegram/tglib/channel.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/routes/telegram/tglib/channel.ts b/lib/routes/telegram/tglib/channel.ts index d9b85e2f0be8bd..bd973133efd4b2 100644 --- a/lib/routes/telegram/tglib/channel.ts +++ b/lib/routes/telegram/tglib/channel.ts @@ -144,8 +144,8 @@ export default async function handler(ctx) { title, description, pubDate: new Date(message.date * 1000).toUTCString(), - link: `https://t.me/s/${channelInfo.username}/${message.id}`, - author: `${channelInfo.title} (@${channelInfo.username})`, + link: `https://t.me/s/${ctx.req.param('username')}/${message.id}`, + author: `${channelInfo.title} (@${ctx.req.param('username')}`, }); } } @@ -153,10 +153,10 @@ export default async function handler(ctx) { return { title: channelInfo.title, language: null, - link: `https://t.me/${channelInfo.username}`, + link: `https://t.me/${ctx.req.param('username')}`, item, allowEmpty: ctx.req.param('id') === 'allow_empty', - description: `@${channelInfo.username} on Telegram`, + description: `@${ctx.req.param('username')} on Telegram`, }; }