draftbit / twitter-lite

A tiny, full-featured, flexible client / server library for the Twitter API
https://npm.im/twitter-lite
MIT License
794 stars 96 forks source link

Tweet on behalf of other users? #198

Closed doohab closed 2 years ago

doohab commented 2 years ago

I have 3 authenticated accounts. But it always tweet for one of them (the developer account) not the others. How to make it tweet for them?

app.post('/tweet', async (req, res) => {

    const client = new Twitter({
        consumer_key: api_key,
        consumer_secret: api_key_secret,
        access_token_key: access_token,
        access_token_secret: access_token_secret
    });

    await client.post("statuses/update", {
      status: "What is this?"
    }).catch(console.error);

    res.sendStatus(200)
});