# Lua command incorrectly saves text

**URL:** <https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241>\
**Category:** Troubleshooting\
**Created:** [March 5, 2021, 10:52pm UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241 "2021-03-05T22:52:58Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdingena](https://forum.farmbot.org/user_avatar/forum.farmbot.org/mdingena/32/65_2.png) [@mdingena](https://forum.farmbot.org/u/mdingena)\
**Post date:** [March 5, 2021, 10:52pm UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/1 "2021-03-05T22:52:58Z")

</div>

I’m using a Lua command to send Slack messages to my workspace. Using an emoji string at the end of the text string does not get saved correctly.

```auto
payload = json.encode({
  text = "I've finished photographing the garden. :camera_with_flash:"
})

```

gets saved as

```auto
payload = json.encode({
  text = "I've finished photographing the garden.
})

```

or

```auto
payload = json.encode({
  text = "I've finished photographing the garden. :camera
})

```

Note that it seems inconsistent in what is saved, but key here is that it’s missing a closing double quote which breaks the script.

I’m entering these strings from my phone, and I have to turn off the monospaced editor for me to even be able to enter text. I tap the `A` button on the command to switch to plain text mode which allows me to type.

---

<div class="post-metadata">

**Author:** ![Ascend](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/a/a9adbd/32.png) [@Ascend](https://forum.farmbot.org/u/Ascend)\
**Post date:** [March 6, 2021, 11:27am UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/2 "2021-03-06T11:27:37Z")

</div>

Tried to reproduce, but it worked fine for me all the time. Writing things in the “fancy editor” doesn’t really work on smartphone as you said. Using the backspace on the onscreen keyboard doesn’t work which makes typos really painful.

---

<div class="post-metadata">

**Author:** ![RickCarlino](https://forum.farmbot.org/user_avatar/forum.farmbot.org/rickcarlino/32/3593_2.png) [@RickCarlino](https://forum.farmbot.org/u/RickCarlino)\
**Post date:** [March 8, 2021, 2:11pm UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/3 "2021-03-08T14:11:20Z")

</div>

@mdingena This sounds like an issue on mobile, as I have previously built Lua scripts that use emojis (on desktop). I will add this to the backlog.

---

<div class="post-metadata">

**Author:** ![RickCarlino](https://forum.farmbot.org/user_avatar/forum.farmbot.org/rickcarlino/32/3593_2.png) [@RickCarlino](https://forum.farmbot.org/u/RickCarlino)\
**Post date:** [March 12, 2021, 6:17pm UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/4 "2021-03-12T18:17:53Z")

</div>

Status update: We were unable to reproduce. We are considering disabling the fancy editor on mobile entirely. More investigation is required.

---

<div class="post-metadata">

**Author:** ![mdingena](https://forum.farmbot.org/user_avatar/forum.farmbot.org/mdingena/32/65_2.png) [@mdingena](https://forum.farmbot.org/u/mdingena)\
**Post date:** [March 13, 2021, 3:50am UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/5 "2021-03-13T03:50:32Z")

</div>

I copy pasted the emoji codes from Slack, perhaps it has something to do with pasting text rather than manually typing with individual keystrokes (don’t know if there is some JS listening for keyup events or something that may be missed with pasting from a soft keyboard).

It’s likely related to using a soft keyboard and not fully registering keystroke events or paste events.

I’ve since managed to get correct messages simply by using a desktop. I think a viable solution for now would be to disable the fancy **but please add some CSS to give the not-fancy editor a monospaced font!**

---

<div class="post-metadata">

**Author:** ![RickCarlino](https://forum.farmbot.org/user_avatar/forum.farmbot.org/rickcarlino/32/3593_2.png) [@RickCarlino](https://forum.farmbot.org/u/RickCarlino)\
**Post date:** [March 13, 2021, 1:08pm UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/6 "2021-03-13T13:08:08Z")

</div>

> [@mdingena](#):
>
> I copy pasted the emoji codes from Slack, perhaps it has something to do with pasting text rather than manually typing with individual keystrokes (don’t know if there is some JS listening for keyup events or something that may be missed with pasting from a soft keyboard).

Are you using any browser extensions that modify/read text input boxes? Examples are password managers, grammar plugins such as Grammarly, etc…

---

<div class="post-metadata">

**Author:** ![RickCarlino](https://forum.farmbot.org/user_avatar/forum.farmbot.org/rickcarlino/32/3593_2.png) [@RickCarlino](https://forum.farmbot.org/u/RickCarlino)\
**Post date:** [March 13, 2021, 1:10pm UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/7 "2021-03-13T13:10:30Z")

</div>

EDIT: I updated the previous comment with regards to your monospace font comment. I read the “not-fancy” part as “fancy”.

I understand what you’re saying about the monospace font. I will add that to the list.

---

<div class="post-metadata">

**Author:** ![mdingena](https://forum.farmbot.org/user_avatar/forum.farmbot.org/mdingena/32/65_2.png) [@mdingena](https://forum.farmbot.org/u/mdingena)\
**Post date:** [March 13, 2021, 11:00pm UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/8 "2021-03-13T23:00:51Z")

</div>

> [@RickCarlino](#):
>
> Are you using any browser extensions that modify/read text input boxes? Examples are password managers, grammar plugins such as Grammarly, etc…

On work Macbook I use 1Password. On my own desktop no such plugins. On my Android phone I don’t use browser plugins. It uses the Gboard soft keyboard. In all cases it would be in the Chrome browser.

---

<div class="post-metadata">

**Author:** ![RickCarlino](https://forum.farmbot.org/user_avatar/forum.farmbot.org/rickcarlino/32/3593_2.png) [@RickCarlino](https://forum.farmbot.org/u/RickCarlino)\
**Post date:** [March 14, 2021, 2:03pm UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/9 "2021-03-14T14:03:39Z")

</div>

@mdingena Quick update: I was able to reproduce yesterday, so that’s good. The bad part is I still don’t have a consistent set of steps to reproduce (only happened ~10% of the time on my machine).

Can you take a screenshot of your Javascript console next time it happens? I think this might be a problem with Monaco (the library that powers the fancy editor).

---

<div class="post-metadata">

**Author:** ![mdingena](https://forum.farmbot.org/user_avatar/forum.farmbot.org/mdingena/32/65_2.png) [@mdingena](https://forum.farmbot.org/u/mdingena)\
**Post date:** [March 14, 2021, 2:30pm UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/10 "2021-03-14T14:30:08Z")

</div>

It’s been a while since I use DevTools on my phone. I hope the experience has been improved since. I’ll let you know if I find anything.

---

<div class="post-metadata">

**Author:** ![monroay566](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@monroay566](https://forum.farmbot.org/u/monroay566)\
**Post date:** [November 26, 2026, 6:26am UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/11 "2026-11-26T06:26:02Z")

</div>

Same kind of paste headache here — copying emoji from a phone keyboard into a message box rarely comes out clean. For plain text emoticons I stopped fighting the keyboard and just grab a ready-made one to paste in. This [Shrug Emoji](https://www.copyshrugmoji.com/) page has the classic ¯\_(ツ)\_/¯ in one click, which is handy when a notification just needs a quick ‘I don’t know’ without the formatting fuss.

---

<div class="post-metadata">

**Author:** ![joshuaseward](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/j/3ab097/32.png) [@joshuaseward](https://forum.farmbot.org/u/joshuaseward)\
**Post date:** [November 26, 2026, 10:35am UTC](https://forum.farmbot.org/t/lua-command-incorrectly-saves-text/7241/12 "2026-11-26T10:35:34Z")

</div>

Since 📸 is plain ASCII, the missing closing quote seems more like a Monaco/mobile input or paste issue than emoji handling. A practical workaround: compose the whole Lua payload in a plain text note app, then paste it into the command field in one go. If it still breaks, try pasting without the final quote and adding that quote manually afterward. That may also help isolate whether Monaco is dropping trailing input during paste.
