This repository has been archived by the owner. It is now read-only.

Params error #180

Closed
cschweda opened this Issue Jan 16, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@cschweda
Copy link

cschweda commented Jan 16, 2018

Bot working, but I keep getting this on successful retweet in console:

Unhandled rejection Error: Twit: Params object is missing a required parameter for this request: `id`

Trace includes:

witter-bot-bootstrap/node_modules/twit/lib/helpers.js:39:13
    at String.replace (<anonymous>)
    at Object.exports.moveParamsIntoPath (/webdev/twitter/twitter-bot-bootstrap/node_modules/twit/lib/helpers.js:35:15)

Ideas for where to fix this?

EDIT:

I fixed the error by in retweet.js by changing:

 if (!isReply(data.statuses[rando])) {
          retweetId = data.statuses[rando].id_str;
        }

to this:

if (!isReply(data.statuses[rando])) {
          retweetId = data.statuses[rando].id_str;
        } else {
          retweetId = data.statuses[rando].id_str;
        }

Not sure if that's the right approach? But no more errors ...

@spences10

This comment has been minimized.

Copy link
Owner

spences10 commented Jan 17, 2018

It's the random rando status ID, sometimes it doesn't exist

A way around this is to not use .get('search/tweets', I found using the twitter stream API more reliable but obviously this will action events as they happen, if you want to add some delay to retweeting take a delay tweet which I put together to do just that 👌 😁

If you think you'd like to add a solution I'm happy to accept a PR @cschweda ❇️ 👍

@cschweda

This comment has been minimized.

Copy link

cschweda commented Jan 18, 2018

Thanks. I'll take a closer look when I get a chance.

@spences10

This comment has been minimized.

Copy link
Owner

spences10 commented Mar 19, 2018

Closing due to inactivity

@spences10 spences10 closed this Mar 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.