Problem with Twitterbot

Hey guys!
I am new in Node-Red programming. I need you help! I want to create a basic Twitter bot that responses the reversed text from the a tweet. The basic things works like sending the same message back. The problem comes when it goes to reverse the text. I use this node-red-contrib-reverse (node) - Node-RED for reversing it. The point is every time I reverse it, It gives me errors, it send me things like [object, Object] or on the reversed part is the username (like elloH stest@).
I don't know what I should do...
Here is my code:


I use for Twitter this: node-red-node-twitter (node) - Node-RED

I just want a basic bot that responses to certain people with the reversed text from their tweet. Like:
personxyz hello!
Bot: !olleh

Please explain the solution noob friendly, so I can understand!

I'd normally love to help a newbie out with Node-RED but the world doesn't need any more twitter bots :slight_smile:

1 Like

Come on :smiley:
The bot is for private use for me and my friends. Don't want to make people mad :frowning:

1 Like

As I don't use twitter, i care not how many bots.

You can use a change node to reverse the text

[{"id":"d6d52728.f577a","type":"change","z":"b779de97.b1b46","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$join($reverse($split($$.payload,\"\")))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":3900,"wires":[["d9a3223d.b2b658"]]},{"id":"d9a3223d.b2b658","type":"debug","z":"b779de97.b1b46","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":3900,"wires":[]},{"id":"3c2e26b8.09178a","type":"inject","z":"b779de97.b1b46","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hello!","payloadType":"str","x":170,"y":3900,"wires":[["d6d52728.f577a"]]}]

The JSONata expression would be

$join($reverse($split($$.payload,"")))

My Twitter drown in Bots.

1 Like

I don't know why this post is deleted but I just want to say it works fine! Thanks :cookie: !

I deleted it as I thought it was the wrong answer. After I posted I had the thought that you need help with twitter integration, not reversing the string. I reversed the delete as it was helpful.

1 Like