Hello!
I am trying to write automation for adding torrents to the transmission from the telegram bot. Integrations with telegram and transmission works well, but apparently there are some problems with the template. The template is needed to remove quotes at the beginning and at the end of {{ trigger.event.data.args }}.
- alias: Telegram Bot Add Torrent
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/add_torrent'
action:
- service: transmission.add_torrent
data_template:
name: Transmission
torrent: >
{% set string = trigger.event.data.args %}
{% set string = string[:-1] %}
{% set string = string[1:] %}
{{ string }}