Twitter bot using Nod-RED


Hi ,
I have created a simple Twitter bot in Node-RED,( with the twitter node updated version),but i'm not able to display messages on twitter.
Could you please help me out with this.
Thank you.


I moved your post to #general as it's not about the development of the core of Node-RED but about how you use / configure a node.


Are there any error messages?

Have you been through the twitter approval process?


Is approval means creating Access token and key?? if yes have created an app in the Twitter dashboard. but In my program the twitter node shows this message
"waiting for search term"


Okay, Thank you


I'm sure we could help, but you need to share some details of what you have done and what isn't working.

The Twitter node generally 'just works' once you have the authentication details setup. Are you trying to update your twitter stream or search for tweets?


Its a simple flow.

  1. Consisting of one Inject Node, One function node , one debug node, one twitter node.
  2. In the function node I have created a program fro generating random numbers ,
    The program is
    return msg;
  3. I have wired the twitter node and function node.
  4. I can able to get the numbers through debug node , but i cannot able to generate the tweets in twitter.

Do you get any errors from the Twitter node?

I note you are passing it a Number rather than a String. I think I'd expect that to work, although equally I wouldn't be surprised if the code assumed a user would be sending actual text. So you could try ensuring msg.payload is a String - msg.payload="My number: "+ran;


I did not get any errors in twitter node , but in bottom i get yellow square and stating "waiting for search term "

yeah sure I will check that and get back to you.


Which Twitter node are you using? That sounds like you are using the Twitter In node - which is used to search for tweets. If you want to update your twitter stream you need to use the Twitter Out node.


yeah It works fine with this.
Thanks .


If i didnot use msgpayload= "My Number "+ran; i get error .
Is there any reason??


Ever error happens for a reason. What error do you get?


TypeError: msg.payload.slice is not a function
I get this error


and what is your function now?
If I have

msg.payload= "My Number "+ran;
return msg;

it works fine


In my earlier reply, I did say this:

The error you are hitting confirms this; the node expects msg.payload to be a String.