import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
export async function postTweet({ accessToken, text, reply }: {
accessToken: string;
text: string;
reply: {
in_reply_to_tweet_id: string;
};
}) {
return fetchJSON(`https://api.twitter.com/2/tweets`, {
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
},
body: JSON.stringify({
text,
reply,
}),
});
}