-
How can I send a tweet as a reply to a tweet I just sent with this package? I want to send 5 images. But since the limit is 4, I want to send the fifth as a response to the tweet |
Beta Was this translation helpful? Give feedback.
Answered by
alkihis
Feb 25, 2022
Replies: 1 comment 1 reply
-
Hi! You can reply to an existing tweet using its ID. const mediaIds = []
for (const image of images) {
// upload your images...
const mediaId = await client.v1.uploadMedia(image)
mediaIds.push(mediaId)
}
// only keep the 4 first images
const firstImages = mediaIds.slice(0, 4)
const remainingImages = mediaIds.slice(4)
// Send your first tweet
const tweet = await client.v1.tweet('Status text', { media_ids: firstImages })
// Reply to the first one
await client.v1.reply(
'reply to previously created tweet.',
tweet.id_str,
{ media_ids: remainingImages },
); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
kass507
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
You can reply to an existing tweet using its ID.