Flexget / Flexget

The official FlexGet repository

Home Page:http://www.flexget.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't talk to my Telegram bot using the Telegram notifier

nbarrientos opened this issue · comments

Expected behaviour:

Flexget sends messages via Telegram to my bot.

Actual behaviour:

no chat id found, try manually sending the bot any message to initialize the chat

Steps to reproduce:

  • Step 1: Create a Telegram bot
  • Step 2: Get the API key via BotFather.
  • Step 3: Send a message to the bot from foo user (direct chat)
  • Step 4: Configure Flexget as follows

Config:

templates:
 ...
  notifyseries:
    notify:
      entries:
        title: "A new episode of {{series_name}} is ready!"
        message: "{{series_id}} ({{quality}})"
        via:
          - telegram:
              bot_token: '{? tg.token ?}'
              recipients:
                - username: '{? tg.myself ?}'

Then use the template in a task classifying files, like:

  sortseries:
    priority: 10
    no_entries_ok: yes
    metainfo_series: yes
    accept_all: yes
    filesystem:
      path: "{? paths.torrent_base ?}/downloads"
      recursive: 3
      retrieve: files
      regexp: '.*\.(avi|mkv|mp4|m4v|ts)$'
    regexp:
      reject:
        - sample
    require_field: series_name
    thetvdb_lookup: yes
    copy:
      to: "{? paths.media_base ?}/Shows/{{tvdb_series_name|default(series_name)}}/Season {{series_season}}/"
    template:
      - notifyseries
      - refreshkodi

tg.myself is a secret, set to foo which is my Telegram username.

Log:

2023-10-09 17:27:51 ERROR notify_entry sortseries no chat id found, try manually sending the bot any message to initialize the chat

Additional information:

  • FlexGet version: Official container image, Flexget version 3.9.10. Nothing Telegram-related in v3.9.10...v3.9.12

I use the bot from Home assistant too and I can see messages sent to it that way. As mentioned, I have sent several messages using user foo to the bot.

Thanks in advance for any insights.

I created a brand new bot and it worked. No idea.