Skip to content

Commit

Permalink
feat(route/twitter): support tweets with replies
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudoyu committed Dec 9, 2024
1 parent 503a779 commit c70fda5
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/routes/twitter/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Route, ViewType } from '@/types';
import utils from './utils';
import api from './api';
import logger from '@/utils/logger';
import { config } from '@/config';

export const route: Route = {
path: '/user/:id/:routeParams?',
Expand Down Expand Up @@ -60,15 +59,9 @@ async function handler(ctx) {
const id = ctx.req.param('id');

// For compatibility
const { count, exclude_replies: initialExcludeReplies, include_rts } = utils.parseRouteParams(ctx.req.param('routeParams'));
const { count, exclude_replies, include_rts } = utils.parseRouteParams(ctx.req.param('routeParams'));
const params = count ? { count } : {};

// Third party API does not support replies for now
let exclude_replies = initialExcludeReplies;
if (config.twitter.thirdPartyApi) {
exclude_replies = true;
}

await api.init();
const userInfo = await api.getUser(id);
let data;
Expand Down

0 comments on commit c70fda5

Please sign in to comment.