Date: Fri, 29 Mar 2024 15:01:12 +0100 (CET) Message-ID: <1363809866.165.1711720872298@vmisdata19.uni-oldenburg.de> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_164_1132850190.1711720872297" ------=_Part_164_1132850190.1711720872297 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
It is possible to use Odysseus together with Telegram (https://= telegram.org/). You need to install the Telegram Wrapper Feature.
The communication is done via a Telegram Bot (https://core.tele= gram.org/bots).
So you first need to create a new telegram bot and get the token.See https://core.telegram.org/bots#6-botfather
Now you can create a source in Odysseus:
#PARSER= PQL #RUNQUERY telegram :=3D RECEIVE({ transport =3D 'Telegram', source =3D 'Telegram', datahandler =3D 'KeyValueObject', OPTIONS =3D [['telegram.api.token','PLACE YOUR TOKEN HERE']= ] } )
You can now process the data. In the following simple example a response= is send to the sender.
Remark: The SENDER currently only supports KeyValueObjects with the attr= ibutes: "chart.id" as long and "text" as String.
#PARSER= PQL #ADDQUERY message =3D KEYVALUETOTUPLE({ schema =3D [ ['message.message_id','long'], ['message.from.id','long'], ['message.from.first_name','String'], ['message.from.last_name','String'], ['message.from.username','String'], ['message.chat.id','long'], ['message.chat.first_name','String'], ['message.chat.last_name','String'], ['message.chat.username','String'], ['message.chat.type','String'], ['message.date','long'], ['message.text','String'] ], keepinput =3D false, type =3D 'Message' =20 }, telegram )=20 =20 reply =3D MAP({ expressions =3D [ ['message.chat.id','chat.id'], ['"Hallo " + message.from.first_name','text'] ] =20 }, message ) =20 replyKV =3D TUPLETOKEYVALUE(reply) =20 out =3D SENDER({ transport =3D 'Telegram', protocol =3D 'None', sink =3D "OdysseusTelegram", wrapper =3D "GenericPush", options =3D [ ['telegram.api.token','PLACE YOUR TOKEN HERE'] ] }, replyKV )