question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sending messages to a group through telegram does not work.

See original GitHub issue

Expected behaviour:

I need to send messages through telegram in a private group

Actual behaviour:

Sending messages to the group does not work. Recommended solutions do not bring a positive result.

Steps to reproduce:

In BotFather /setprivacy status is: DISABLED Remove the bot from the group and turn on the bot into the group again. Send a bot report to the group in the form: /start@name_bot

(click to expand screenshot) drawing

Sending through username is working fine:

(click to expand screenshot) drawing

Config:

web_server:
  bind: 0.0.0.0
  port: 5051
  web_ui: yes
tasks:
  telegram:
    priority: 4
    no_entries_ok: yes
    mock:
      - {title: "fooff1f908"}
    accept_all: yes
    notify:
      entries:
        message: "Testing Telegram..."
        via:
          - telegram:
              bot_token: "1771047074:AAEIRPWWVb0fMYLEDzTKFfCj8__________"
              parse_mode: markdown
              recipients:
                 - group: '-10014450_____'

Log:

(click to expand)
2021-03-29 15:31:55 DEBUG    task          telegram        executing telegram
2021-03-29 15:31:55 DEBUG    remember_rej  telegram        Task config has changed since last run, purging remembered entries.
2021-03-29 15:31:55 DEBUG    backlog       telegram        0 entries purged from backlog
2021-03-29 15:31:55 VERBOSE  details       telegram        Produced 1 entries.
2021-03-29 15:31:55 VERBOSE  task          telegram        ACCEPTED: `fooff1f908` by accept_all plugin
2021-03-29 15:31:56 DEBUG    urlrewriter   telegram        Checking 1 entries
2021-03-29 15:31:56 VERBOSE  details       telegram        Summary - Accepted: 1 (Rejected: 0 Undecided: 0 Failed: 0)
2021-03-29 15:31:56 DEBUG    notify        telegram        Sending a notification to `telegram`
2021-03-29 15:31:56 DEBUG    telegram      telegram        token=1771047074:AAEIRPWWVb0fMYLEDzTKFfCj8__________, parse_mode=markdown, disable_previews=False, usernames=[], fullnames=[], groups=['-10014450_____']
2021-03-29 15:31:56 DEBUG    telegram.bot  telegram        Entering: get_me
2021-03-29 15:31:56 DEBUG    telegram.vendor.ptb_urllib3.urllib3.connectionpool telegram        Starting new HTTPS connection (1): api.telegram.org
2021-03-29 15:31:56 DEBUG    telegram.vendor.ptb_urllib3.urllib3.connectionpool telegram        https://api.telegram.org:443 "GET /bot1771047074:AAEIRPWWVb0fMYLEDzTKFfCj8__________/getMe HTTP/1.1" 200 197
2021-03-29 15:31:56 DEBUG    telegram.bot  telegram        {'id': 1771047074, 'first_name': 'flexget_bot', 'is_bot': True, 'username': 'vz_flexget_bot', 'can_join_groups': True, 'can_read_all_group_messages': True, 'supports_inline_queries': False}
2021-03-29 15:31:56 DEBUG    telegram.bot  telegram        Exiting: get_me
2021-03-29 15:31:56 DEBUG    telegram      telegram        loading cached chat ids
2021-03-29 15:31:56 DEBUG    telegram      telegram        found 0 cached chat_ids: []
2021-03-29 15:31:56 DEBUG    telegram      telegram        loading new chat ids
2021-03-29 15:31:56 DEBUG    telegram.bot  telegram        Entering: get_updates
2021-03-29 15:31:56 DEBUG    telegram.vendor.ptb_urllib3.urllib3.connectionpool telegram        https://api.telegram.org:443 "POST /bot1771047074:AAEIRPWWVb0fMYLEDzTKFfCj8__________/getUpdates HTTP/1.1" 200 23
2021-03-29 15:31:56 DEBUG    telegram.bot  telegram        No new updates found.
2021-03-29 15:31:56 DEBUG    telegram.bot  telegram        []
2021-03-29 15:31:56 DEBUG    telegram.bot  telegram        Exiting: get_updates
2021-03-29 15:31:56 DEBUG    telegram      telegram        found 0 new chat_ids: []
2021-03-29 15:31:56 DEBUG    telegram      telegram        chat_ids=[]
2021-03-29 15:31:56 ERROR    notify_entry  telegram        no chat id found, try manually sending the bot any message to initialize the chat
2021-03-29 15:31:56 DEBUG    seen          telegram        Learned 'fooff1f908' (field: title, local: False)
2021-03-29 15:31:56 DEBUG    seen          telegram        Learned 'mock://localhost/mock/-8919348216849832715' (field: url, local: False)
2021-03-29 15:31:56 DEBUG    util.simple_persistence telegram        Flushing simple persistence for task telegram to db.
2021-03-29 15:31:56 DEBUG    util.simple_persistence telegram        Flushing simple persistence for task None to db.

Additional information:

  • FlexGet version: v3.1.107 (docker: wiserain/flexget) pre-installed dependencies for plugins telegram cfscraper convert_magnet decompress transmission deluge irc

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
soloamcommented, Apr 5, 2021

Yes I understand it’s private! But try doing the config without using the group chat_id, but using the group name, exactly like it’s displayed in telegram! Then before you execute the task in flexget send a message in the private group to the bot

This message will allow flexget to map the group name to the chat_id

0reactions
javikobcncommented, May 9, 2022

You need to send a message from your chat, directly to your bot.

Go to telegram, open the chat where you would like to receive the messages, and ensure that the bot is present (if it’s a group chat), then send a message to that chat and run the flexget task that sends messages. Flexget should detect the message and pull the chat ID.

Yeah I have tried that and created a new bot (adding the new bot token to the config) and new group (adding the new groupname to the config) and problem persists. Could it be that there is a problem in the database due to having migrated the config from another nas to this one? I say this because of what you wrote in your previous message. By the way I leave the config that I use in case it helps

`telegram: notify: entries: message: |+ {%if task in [“move movies”]%}Nueva Pelí­cula renombrada: {{title}}{%endif%}

      *Tí­tulo:* {%if tmdb_name|default(False)%}{{tmdb_name}} ({{tmdb_year}}){%endif%} 
      *Tamaño:* {{content_size}} MB
      *Valoración:* {{tmdb_rating|d('?')}}/10 - {{tmdb_popularity|d('N/A')}} votos
      [Poster]{% if tmdb_posters|default(False) %}({{tmdb_posters[0]|replace("_", "%5F")}}){% endif %}
      {%else%}
    what: rejected
    message: |+
        <b>Película no renombrada ni movida:</b>
        {{ title }}
        <b>Ha sido rechazada por</b>
        {{ reason }}
    via:
      - telegram:
          bot_token: mybot_token
          parse_mode: html
          recipients:
            - group: mygroup`
Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Fix Telegram Cannot Send Messages Issue
The Telegram cannot send messages problem occurs when you are trying to send out a message to a person or group of people....
Read more >
Telegram Not Sending Messages? 9 Ways To Fix The ...
To fix Telegram not sending messages, change your internet connection, clear cache, restart your phone, reinstall app, use the web, or use ...
Read more >
Can't Send Messages on Telegram [10 Ways to Fix in 2022]
1. Switch Between Mobile Data and WiFi · 2. Disable Background Restrictions · 3. Turn off Do Not Disturb mode · 4. Contact...
Read more >
Can't Send Messages On Telegram - Help Fix That
Are you trying to communicate with your friends but you can't send messages on Telegram? Here are some easy fixes to get this...
Read more >
Why can't I message a non-contact on Telegram? - Quora
This could mean that your number is out there somewhere in a collective database. And you are being targeted as one of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found