Skip to content

types.ChatMemberUpdated Can't parse entities: unsupported start tag "aiogram.types.user.user" at byte offset 1 #1178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
azimxxm opened this issue May 14, 2023 · 3 comments
Labels
needs triage This issue is not yet confirmed

Comments

@azimxxm
Copy link

azimxxm commented May 14, 2023

Context

aiogram.utils.exceptions.CantParseEntities: Can't parse entities: unsupported start tag "aiogram.types.user.user" at byte offset 1

@dp.chat_member_handler(IsGroup())
async def handle_chat_member_updated(message: types.ChatMemberUpdated):
    chat_id = message.chat.id
    user_id = message.from_user.id
    new_chat_member = message.new_chat_member
    old_chat_member = message.old_chat_member

    if new_chat_member:
        # User joined or was added to the chat
        if new_chat_member.user.id == bot.id:
            # Bot was added to the chat
            print(f"Bot joined the chat. Chat ID: {chat_id}")
        else:
            # User joined the chat
            print(f"User {new_chat_member.user.username} (ID: {user_id}) joined the chat. Chat ID: {chat_id}")
    elif old_chat_member:
        # User was removed or left the chat
        if old_chat_member.user.id == bot.id:
            # Bot was removed from the chat
            print(f"Bot was removed from the chat. Chat ID: {chat_id}")
        else:
            # User left the chat
            print(f"User {old_chat_member.user.username} (ID: {user_id}) left the chat. Chat ID: {chat_id}")
@Olegt0rr
Copy link
Contributor

@azimxxm , please provide full traceback

@Olegt0rr Olegt0rr added the needs triage This issue is not yet confirmed label May 14, 2023
@azimxxm
Copy link
Author

azimxxm commented May 31, 2023

thank you very much for the reply i have fixed the error. I have no problems so far, thank you very much!!

@justdoingthings
Copy link

thank you very much for the reply i have fixed the error. I have no problems so far, thank you very much!!

how did u fix this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue is not yet confirmed
Projects
None yet
Development

No branches or pull requests

4 participants