Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createMetaData error? #93

Closed
shiffman opened this issue Oct 6, 2021 · 4 comments
Closed

createMetaData error? #93

shiffman opened this issue Oct 6, 2021 · 4 comments

Comments

@shiffman
Copy link

shiffman commented Oct 6, 2021

Hello! I'm so excited to find this package! I've been using Twit and other node.js implementations for many years and have been hoping to find something up-to-date and actively maintained!

I ran across an issue attempting to add "alt text" to an image, this fails for me with a 400 error:

const mediaId = await client.v1.uploadMedia('rainbow.png', { type: 'png' });
await client.v1.createMediaMetadata(`${mediaId}`, { alt_text: 'Rainbow!' });

However, I am able to get it to work by calling post() directly.

const mediaId = await client.v1.uploadMedia('rainbow.png', { type: 'png' });
await client.v1.post('media/metadata/create.json', {
  media_id: `${mediaId}`,
  alt_text: {
    text: 'Rainbow!',
  },
});

My repo of examples is in progress here: https://github.com/shiffman/Twitter-Bots-F21

@alkihis
Copy link
Collaborator

alkihis commented Oct 7, 2021

Hello! Thank you for your support :)
You're right, the parameters of createMediaMetadata are incorrectly typed.
It should be fixed on the next update that should come in the next few days!

@alkihis
Copy link
Collaborator

alkihis commented Oct 9, 2021

Hi,
1.6.0 version, that fixes the issue, is now available on npm :)
You can safely use .createMediaMetadata again!

Thanks you for the report!

@shiffman
Copy link
Author

Yay, thank you!! Trying this out now!

@shiffman
Copy link
Author

Confirmed! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants