Skip to content
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

AddStickerToSetRequest api failed #4387

Open
3 tasks done
GodFatherClover opened this issue Jun 2, 2024 · 0 comments
Open
3 tasks done

AddStickerToSetRequest api failed #4387

GodFatherClover opened this issue Jun 2, 2024 · 0 comments

Comments

@GodFatherClover
Copy link

Code that causes the issue


        for attr in message.sticker.attributes:
            if isinstance(attr, types.DocumentAttributeSticker):
                if type(attr.stickerset) is InputStickerSetID:
                    sticker_id = attr.stickerset.id
                    sticker_access_hash = attr.stickerset.access_hash
                    
                    result = await client(functions.stickers.AddStickerToSetRequest(
                        stickerset=types.InputStickerSetID(
                            id=sticker_id, access_hash=sticker_access_hash,
                        ),
                        sticker=types.InputStickerSetItem(
                            document=types.InputDocument(
                                id=message.sticker.id, access_hash=message.sticker.access_hash,
                                file_reference=message.sticker.file_reference
                            ),
                            emoji='some string here',

                        )
                    ))
                    print(result.stringify())

Expected behavior

AddStickerToSetRequest success

Actual behavior

The provided sticker set is invalid (caused by AddStickerToSetRequest)

Traceback

No response

Telethon version

1.35

Python version

3.11

Operating system (including distribution name and version)

windows 11

Other details

No response

Checklist

  • The error is in the library's code, and not in my own.
  • I have searched for this issue before posting it and there isn't an open duplicate.
  • I ran pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip and triggered the bug in the latest version.
@GodFatherClover
Copy link
Author

QQ截图20240602131152

the message.sticker is above picture show

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant