I’ve just started playing with this so it’s a very preliminary work, inspired by Rhasspy to HABot
from core.actions import HTTP
import json
@rule("Telegram message")
@when("Item Telegram_Message received update")
def telegram_message(event):
url = "http://server:8484/rest/habot/chat"
contenttype = "text/plain"
request = event.itemState.toString()
output = HTTP.sendHttpPostRequest(url, contenttype, request)
response = json.loads(output)
telegram_message.log.info("Output: {}, json: {}".format(output, response))
message = "{} {}".format(response.get("answer"), response.get("card", {}).get("title", ""))
actions.get("telegram","telegram:telegramBot:YOURBOTNAME").sendTelegram(message)
Because I use gboard, I can even issue my command by voice