# Problem with Twitterbot

**URL:** <https://discourse.nodered.org/t/problem-with-twitterbot/52986>\
**Category:** General\
**Created:** [30 October 2021 20:37 UTC](https://discourse.nodered.org/t/problem-with-twitterbot/52986 "2021-10-30T20:37:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BioKeks](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BioKeks](https://discourse.nodered.org/u/BioKeks)\
**Post date:** [30 October 2021 20:37 UTC](https://discourse.nodered.org/t/problem-with-twitterbot/52986/1 "2021-10-30T20:37:04Z")

</div>

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](https://flows.nodered.org/node/node-red-contrib-reverse) 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:

 ![code](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/315ab7cb6da75421e041970a64d1ef5d988d38df.png)  
 ![code2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/98d735aec3591dd3959707356b80564d4062a65b.png)

I use for Twitter this: [node-red-node-twitter (node) - Node-RED](https://flows.nodered.org/node/node-red-node-twitter/in/WAIyVYnmOvnu)

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!

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [30 October 2021 20:47 UTC](https://discourse.nodered.org/t/problem-with-twitterbot/52986/2 "2021-10-30T20:47:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BioKeks](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BioKeks](https://discourse.nodered.org/u/BioKeks)\
**Post date:** [30 October 2021 20:49 UTC](https://discourse.nodered.org/t/problem-with-twitterbot/52986/3 "2021-10-30T20:49:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [30 October 2021 20:57 UTC](https://discourse.nodered.org/t/problem-with-twitterbot/52986/4 "2021-10-30T20:57:04Z")

</div>

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

You can use a change node to reverse the text

```auto
[{"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

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

```

My Twitter drown in Bots.

---

<div class="post-metadata">

**Author:** ![BioKeks](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BioKeks](https://discourse.nodered.org/u/BioKeks)\
**Post date:** [30 October 2021 21:08 UTC](https://discourse.nodered.org/t/problem-with-twitterbot/52986/5 "2021-10-30T21:08:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [30 October 2021 21:22 UTC](https://discourse.nodered.org/t/problem-with-twitterbot/52986/6 "2021-10-30T21:22:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 December 2021 21:23 UTC](https://discourse.nodered.org/t/problem-with-twitterbot/52986/7 "2021-12-29T21:23:37Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
