Wathik
July 28, 2021, 7:46am
1
Hi, im using a web html and JS file with API, Im looking to send a log to my farmbot. How is this done, the documentation is a bit confusing.
With python its as simple as request_id1 = bot.send_message("Hello, this is being controlled through the API ")
Thanks
PS: I can move my farmbot through the web and API, so my connections work.
1 Like
Wathik
July 28, 2021, 1:32pm
2
@RickCarlino replied in another post that FarmBotJS does not have a send_message
helper yet. No one has requested it until now. He can add this to a future version of FBJS, though.
Thank you Rick for the support, I truly appreciate it!
2 Likes
Wathik
July 31, 2021, 1:45am
3
UPDATE: It has been implemented now, here is the code:
<script>
function sendLogMessage() {
var farmbot123 = new fbjs.Farmbot({ token: TOKEN });
farmbot123
.connect()
.then(function () {
return farmbot123.sendMessage("info", "Hello, world!");
});
}
</script>
2 Likes