Skip to content

The value of invite_link and linked_chat_id is None when new_chat_members is used #1897

@MaGua-Bishop

Description

@MaGua-Bishop

Please answer these questions before submitting your issue. Thanks!

  1. What version of pyTelegramBotAPI are you using?
    pyTelegramBotAPI=4.9.0
  2. What OS are you using?
    Mac os m.2
  3. What version of python are you using?
    python3.8

I used bot to generate an invitation link (bot.create_chat_invite_link). When I clicked the invitation link to join, I saw that invite_link was None, but I just need this information, can you help me?

@bot.message_handler(chat_types=['group', 'supergroup'], content_types=['new_chat_members'])
def new_chat_members(message):
    print(message)
{'content_type': 'new_chat_members', 'id': 25, 'message_id': 25, 'from_user': {'id': 5920434339, 'is_bot': False, 'first_name': 'xxx', 'username': 'MaGua_bots', 'last_name': None, 'language_code': 'zh-hans', 'can_join_groups': None, 
'can_read_all_group_messages': None, 'supports_inline_queries': None, 'is_premium': None, 'added_to_attachment_menu': None}, 'date': 1675130878, 'chat': {'id': -1001831773092, 'type': 'supergroup', 'title': 'xxx', 'username': 'dasd1c', 
'first_name': None, 'last_name': None, 'is_forum': None, 'photo': None, 'bio': None, 'join_to_send_messages': None, 'join_by_request': None, 'has_private_forwards': None,
 'has_restricted_voice_and_video_messages': None, 'description': None, 'invite_link': None, 'pinned_message': None, 'permissions': None, 'slow_mode_delay': None, 'message_auto_delete_time': None, 
'has_protected_content': None, 'sticker_set_name': None, 'can_set_sticker_set': None, 'linked_chat_id': None, 'location': None, 'active_usernames': None, 'emoji_status_custom_emoji_id': None, 'has_hidden_members': None, 
'has_aggressive_anti_spam_enabled': None}, 'sender_chat': None, 'forward_from': None, 'forward_from_chat': None, 'forward_from_message_id': None, 'forward_signature': None, 'forward_sender_name': None,
 'forward_date': None, 'is_automatic_forward': None, 'reply_to_message': None, 'via_bot': None, 'edit_date': None, 'has_protected_content': None, 'media_group_id': None, 'author_signature': None,
 'text': None, 'entities': None, 'caption_entities': None, 'audio': None, 'document': None, 'photo': None, 'sticker': None, 'video': None, 'video_note': None, 'voice': None, 'caption': None, 'contact': None, 
'location': None, 'venue': None, 'animation': None, 'dice': None, 'new_chat_member': None, 'new_chat_members': [<telebot.types.User object at 0x7fa5a801b6a0>], 'left_chat_member': None,
 'new_chat_title': None, 'new_chat_photo': None, 'delete_chat_photo': None, 'group_chat_created': None, 'supergroup_chat_created': None, 'channel_chat_created': None, 'migrate_to_chat_id': None, 
'migrate_from_chat_id': None, 'pinned_message': None, 'invoice': None, 'successful_payment': None, 'connected_website': None, 'reply_markup': None, 'message_thread_id': None, 'is_topic_message': None, 'forum_topic_created': None, 'forum_topic_closed': None, 'forum_topic_reopened': None, 'has_media_spoiler': None, 
'forum_topic_edited': None, 'general_forum_topic_hidden': None, 'general_forum_topic_unhidden': None, 'write_access_allowed': None, 'json': {'message_id': 25, 'from': {'id': 5920434339, 'is_bot': False, 'first_name': 'xxx', 'username': 'MaGua_bots', 'language_code': 'zh-hans'}, 'chat': {'id': -1001831773092, 'title': 'xxx', 'username': 'dasd1c', 'type': 'supergroup'}, 'date': 1675130878, 'new_chat_participant': {'id': 5920434339, 'is_bot': False, 'first_name': 'xxx', 'username': 'MaGua_bots', 'language_code': 'zh-hans'}, 'new_chat_member': {'id': 5920434339, 'is_bot': False, 'first_name': 'xxx', 'username': 'MaGua_bots', 'language_code': 'zh-hans'}, 'new_chat_members': [{'id': 5920434339, 'is_bot': False, 'first_name': 'xxx', 'username': 'MaGua_bots', 'language_code': 'zh-hans'}]}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions