I'm encountering an issue with the client.v2.tweet function from the Twitter API library within supabase cloud functions. The problem is that when I use this function to post a tweet, it doesn't seem to return a response as expected, and it leads to the server becoming unresponsive or freezing. but it does post the tweet to my twitter account.
code
const client = userClient.readWrite;
try{
const postTweet = await client.v2.tweet({text:tweetText});
// console.log(postTweet )
return new Response(
JSON.stringify({
message: postTweet,
}),
{ headers: { "Content-Type": "application/json" }, status: 200, },
);
}catch(e){
const error = {
message: e,
};
return new Response(
JSON.stringify(error),
{ headers: { "Content-Type": "application/json" },status:300 },
);
}
Please let me know if there are any suggestions or potential solutions to resolve this issue. Your assistance is greatly appreciated.
I'm encountering an issue with the client.v2.tweet function from the Twitter API library within supabase cloud functions. The problem is that when I use this function to post a tweet, it doesn't seem to return a response as expected, and it leads to the server becoming unresponsive or freezing. but it does post the tweet to my twitter account.
code
Please let me know if there are any suggestions or potential solutions to resolve this issue. Your assistance is greatly appreciated.