{"record":{"id":"33ac7dd65367954a","repo":"moeru-ai/airi","slug":"tweet-id-is-empty-please-provide-a-tweet-id-to-li","errorCode":null,"errorMessage":"Tweet ID is empty. Please provide a tweet ID to like.","messagePattern":"Tweet ID is empty\\. Please provide a tweet ID to like\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"integrations/twitter-services/src/adapters/airi-adapter.ts","lineNumber":168,"sourceCode":"        data: {\n          text: `Found ${tweets.length} tweets for '${content}':\n${tweets.slice(0, 5).map((t: Tweet) => `- ${t.text.substring(0, 100)}...`).join('\\n')}`,\n        },\n      })\n      return true\n    }\n    else {\n      throw new Error('Search query is empty. Please provide a query to search.')\n    }\n  }\n\n  private async handleLikeTweet(content: string): Promise<void> {\n    if (content) {\n      await this.twitterServices.tweet.likeTweet(content)\n      logger.main.log(`Liked tweet: ${content}`)\n    }\n    else {\n      throw new Error('Tweet ID is empty. Please provide a tweet ID to like.')\n    }\n  }\n\n  private async handleRetweet(content: string): Promise<void> {\n    if (content) {\n      await this.twitterServices.tweet.retweet(content)\n      logger.main.log(`Retweeted: ${content}`)\n    }\n    else {\n      throw new Error('Tweet ID is empty. Please provide a tweet ID to retweet.')\n    }\n  }\n\n  private async handleGetUser(content: string): Promise<boolean> {\n    if (content) {\n      const userProfile = await this.twitterServices.user.getUserProfile(content)\n      logger.main.log(`Retrieved profile for user: @${content}`)\n      // Return user info to the user","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/moeru-ai/airi/blob/27111382b4a79a7e983289d6e983a06af185ed0f/integrations/twitter-services/src/adapters/airi-adapter.ts#L150-L186","documentation":"Thrown by handleLikeTweet when the parsed command's content is falsy — i.e. 'like tweet:' was sent with no tweet id. This is a plain Error raised before likeTweet is called, so no browser navigation occurs.","triggerScenarios":"User sends 'like tweet:' with nothing after the colon; parseTwitterCommand matched the 'like tweet' prefix but content is empty/whitespace.","commonSituations":"User forgot to paste the tweet id/status URL; LLM truncated the payload; empty input forwarded by the AIRI input:text event.","solutions":["Provide a non-empty tweet id (or status URL) after 'like tweet:'.","Validate content in the parser and reprompt for the id before dispatch.","Have the adapter reply with usage guidance instead of throwing."],"exampleFix":"// before\nif (content) { await this.twitterServices.tweet.likeTweet(content) } else {\n  throw new Error('Tweet ID is empty. Please provide a tweet ID to like.')\n}\n\n// after\nconst id = content?.trim()\nif (!id) {\n  this.client.send({ type: 'input:text', data: { text: 'Usage: like tweet: <tweetId>' } })\n  return\n}","handlingStrategy":"validation","validationCode":"const id = (content ?? '').trim()\nif (!id) {\n  throw new Error('Tweet ID required')\n}\nawait adapter.handleLikeTweet(id)","typeGuard":"function isEmptyLikeIdError(e: unknown): boolean {\n  return e instanceof Error && /tweet ID to like/i.test(e.message)\n}","tryCatchPattern":"try {\n  await this.handleLikeTweet(content)\n} catch (e) {\n  if (e instanceof Error && /tweet ID to like/i.test(e.message)) {\n    this.client.send({ type: 'input:text', data: { text: 'Usage: like tweet: <tweetId>' } })\n  } else throw e\n}","preventionTips":["Validate parsed content for the 'like tweet' command before dispatch.","Always include the tweet id or status URL after the prefix.","Reply with usage hints instead of throwing on empty input."],"tags":["twitter","validation","like","adapter","empty-input"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}