PLhery / node-twitter-api-v2

Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
https://www.npmjs.com/package/twitter-api-v2
Apache License 2.0
1.24k stars 174 forks source link

[bug] #473

Open Magendran123 opened 1 year ago

Magendran123 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

using your package i can able to post a tweet successfully. thank you for that. but i cannot able to reply a tweet using your package.

To Reproduce Please indicate all steps that lead to this bug:

  1. Request client setup (login method, OAuth2 scopes if applicable...)

    const client = new TwitterApi({ appKey: config.twitter_config.api_key, appSecret: config.twitter_config.api_secret, accessToken: config.twitter_config.access_token, accessSecret: config.twitter_config.access_secret, }); using these authentication. works for create a tweet.

Endpoint used

  1. Endpoint used or code example of what's happening wrong async function replyToTweet() { try {

        let tweet =  await twitterClient.v1.reply('Look at my video!', 1657981147555717120);
          console.log('Reply sent successfully:', tweet.text);
        } catch (error) {
          console.error('Error replying to tweet:', error.data);
        }
      }

Error stack trace

  1. Error stack trace, and if possible, error content (err.toJSON() when err is the caught error; take care of removing authentication HTTP headers)

    data: { title: 'Unsupported Authentication', detail: 'Authenticating with OAuth 2.0 Application-Only is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context].', type: 'https://api.twitter.com/2/problems/unsupported-authentication', status: 403 }

Expected behavior A clear and concise description of what you expected to happen.

*i want to post reply in tweet

Version

Additional context Add any other context about the problem here.

Screenshot (507)

sarathkmrdev commented 1 year ago

hi @Magendran123
I am getting same error while creating tweet. found any fix ? can you share your code used for creating tweet?

muhitrhn commented 1 year ago

Applications can't create tweets, only users can.