Skip to content

Commit

Permalink
docs: Add JSDoc documentation to post.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
madjin committed Dec 29, 2024
1 parent 88fc899 commit 872701f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/plugin-twitter/src/actions/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ import { Scraper } from "agent-twitter-client";
import { tweetTemplate } from "../templates";
import { isTweetContent, TweetSchema } from "../types";

/**
* Composes a tweet based on a provided memory message and optional state.
* @param {IAgentRuntime} runtime - The agent runtime object.
* @param {Memory} _message - The memory message to compose the tweet from.
* @param {State} [state] - The optional state object.
* @returns {Promise<string>} The composed tweet content.
*/
async function composeTweet(
runtime: IAgentRuntime,
_message: Memory,
Expand Down Expand Up @@ -60,6 +67,13 @@ async function composeTweet(
}
}

/**
* Posts a tweet on Twitter using the provided content.
*
* @param {string} content - The content of the tweet to be posted.
* @returns {Promise<boolean>} - A boolean indicating whether the tweet was successfully posted or not.
*/

async function postTweet(content: string): Promise<boolean> {
try {
const scraper = new Scraper();
Expand Down

0 comments on commit 872701f

Please sign in to comment.