Telegram bot triggers stopped working

Telegram bot triggers were working normally but after HA update they stopped working. No configuration changes on HA. Tried couple restarts no effect. Removed telegram bot from /homeassistant/configuration.yaml and restarted HA. Then added the telegram bot back. Still the triggers won’t work. I thought maybe something changed and my code isn’t valid anymore so I removed all my config and copy pasted an example code from: Telegram bot - Home Assistant

Now the config is (/homeassistant/configuration.yaml):

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Example configuration.yaml entry for the Telegram Bot
telegram_bot:
  - platform: polling
    api_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    allowed_chat_ids:
      - XXXXXXXXXXX
      
alias: "Telegram bot that reply pong to ping"
triggers:
  - trigger: event
    event_type: telegram_command
    event_data:
      command: "/ping"
actions:
  - action: notify.notify
    data:
      message: "pong"

When I check the config I get the following errors:
Integration error: alias - Integration ‘alias’ not found.
Integration error: actions - Integration ‘actions’ not found.
Integration error: triggers - Integration ‘triggers’ not found.

The telegram bot itself seem to work since I can send a message from development tools → services → Telegram bot: send message. Anyone knows how to fix this?

The automation goes under the automation: integration as a list, or in your automations.yaml include file (without the fist line).

configuration.yaml

automation:
  - alias: "Telegram bot that reply pong to ping"
    triggers:
      - trigger: event
        event_type: telegram_command
        event_data:
          command: "/ping"
    actions:
      - action: notify.notify
        data:
          message: "pong"

I suppose the example is written for entry via the automation editor YAML mode rather than directly in your configuration.yaml file.

The way you have shown it the automation would never have worked.

Thank you, that was what I forgot. Now it’s all back working, Not sure what tha original problem was.