fix(route/telegram): fix channel media path overlap (#20085)
This commit is contained in:
parent
9f8e967c8a
commit
2566b86617
|
|
@ -161,9 +161,9 @@ function streamResponse(c: Context, bodyIter: AsyncGenerator<Buffer>) {
|
|||
}
|
||||
|
||||
export const route: Route = {
|
||||
path: '/channel/:entityName/:messageId',
|
||||
path: '/media/:entityName/:messageId',
|
||||
categories: ['social-media'],
|
||||
example: '/channel/telegram/1233',
|
||||
example: '/telegram/media/telegram/1233',
|
||||
parameters: { entityName: 'entity name', messageId: 'message id' },
|
||||
features: {
|
||||
requireConfig: [
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { getGeoLink, getMediaLink } from './tglib/channel';
|
|||
export const route: Route = {
|
||||
path: '/stories/:username/:story?',
|
||||
categories: ['social-media'],
|
||||
example: '/stories/sandboxuser1',
|
||||
example: '/telegram/stories/telegram',
|
||||
parameters: { username: 'entity name', story: 'story' },
|
||||
features: {
|
||||
requireConfig: [
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ export default async function handler(ctx: Context) {
|
|||
}
|
||||
// messages that have no text are shown as if they're one post
|
||||
// because in TG only 1 attachment per message is possible
|
||||
const src = `${new URL(ctx.req.url).origin}/telegram/channel/${username}/${message.id}`;
|
||||
const src = `${new URL(ctx.req.url).origin}/telegram/media/${username}/${message.id}`;
|
||||
attachments.push(getMediaLink(src, media));
|
||||
}
|
||||
if (message.replyMarkup instanceof Api.ReplyInlineMarkup) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue