Skip to content

Commit

Permalink
fix: ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sukbearai committed Jan 7, 2025
1 parent 1b2ace5 commit 792bc75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/scenes/kol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ kolScene.on('text', async (ctx) => {
const profile = (await twitterManager.fetchProfile(msg)) as TwitterProfile
const content = await twitterManager.handleTwitterKolList(msg, 'kol')

if (profile?.screenName) {
if (profile) {
await ctx.replyWithMediaGroup([
{
type: 'photo',
Expand Down
4 changes: 2 additions & 2 deletions src/twitter/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export class TwitterManager {
}
}

async fetchProfile(username: string): Promise<TwitterProfile | string> {
async fetchProfile(username: string): Promise<TwitterProfile | null> {
try {
const profile = await this.requestQueue.add(async () => {
const profile = await this.twitterClient.getProfile(username)
Expand All @@ -286,7 +286,7 @@ export class TwitterManager {
} catch (error) {
console.error('Error fetching Twitter profile:', error)

return 'error'
return null
}
}

Expand Down

0 comments on commit 792bc75

Please sign in to comment.