Sitelet https://web.archive.org/web/20231224135951/https://github.com/pyrogram/pyrogram/issues/698
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

AttributeError with ChatPermissions. ('ChatPermissions' object has no attribute 'can_send_stickers') #698

Closed
3 tasks done
StarkGang opened this issue Jun 16, 2021 · 1 comment · Fixed by #746
Closed
3 tasks done

Comments

@StarkGang
Copy link

StarkGang commented Jun 16, 2021 •

Checklist

  • I am sure the error is coming from Pyrogram's code and not elsewhere.
  • I have searched in the issue tracker for similar bug reports, including closed ones.
  • I ran pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip and reproduced the issue using the latest development version.

Description

After this commit, It seems that can_send_stickers has been removed. but it has been not updated here

Code

from pyrogram import Client, filters
from pyrogram.types import ChatPermissions

@Client.on_message(filters.me)
async def test(client, message):
    await client.restrict_chat_member(
            message.chat.id, message.reply_to_message.from_user.id, ChatPermissions(can_send_messages=False)

Traceback

Traceback (most recent call last):
  File "<string>", line 4, in __aexec
  File "/usr/local/lib/python3.9/site-packages/pyrogram/methods/chats/restrict_chat_member.py", line 82, in restrict_chat_member
    send_stickers=True if not permissions.can_send_stickers else None,
AttributeError: 'ChatPermissions' object has no attribute 'can_send_stickers'
@vellrya
Copy link

vellrya commented Aug 12, 2021

I can confirm that issue present on development version (pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip)

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

Successfully merging a pull request may close this issue.

2 participants