-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
Issue I am facing
I am facing issue when trying to set permission for send poll to True
chat.set_permissions(permission=ChatPermissions(can_send_polls=True))
Then send media, send stickers and gifs, and embed links are turned off.
Because it should not, so i am going to check current permission and replace to new permission and set new one.
And now i am stuck at ChatPermission, since it wasn't dict. So i can't merge or append at ChatPermission.
Traceback to the issue
chat.set_permissions(permission=ChatPermissions(can_send_polls=True))
changed default permissions
+Send polls
−Send media
−Send stickers & GIFs
−Embed links
Related part of your code
current = context.bot.getChat(chat_id).permissions
new = {'can_send_polls': True}
permissions = {'can_send_messages': None, 'can_send_media_messages': None, 'can_send_polls': None, 'can_send_other_messages': None, 'can_add_web_page_previews': None, 'can_change_info': None, 'can_invite_users': None, 'can_pin_messages': None}
permissions.update(current)
permissions.update(new)
# ???
doing chat.set_permissions(permission=permissions) will got error since set_permissions is converting to_dict() at
python-telegram-bot/telegram/bot.py
Line 2935 in 16613d7
| data = {'chat_id': chat_id, 'permissions': permissions.to_dict()} |
Metadata
Metadata
Assignees
Labels
No labels