mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
send_chat_permissions fix
This commit is contained in:
parent
dbff7cbb3e
commit
32dc03ec44
@ -671,7 +671,8 @@ def promote_chat_member(
|
||||
def set_chat_administrator_custom_title(token, chat_id, user_id, custom_title):
|
||||
method_url = 'setChatAdministratorCustomTitle'
|
||||
payload = {
|
||||
'chat_id': chat_id, 'user_id': user_id, 'custom_title': custom_title}
|
||||
'chat_id': chat_id, 'user_id': user_id, 'custom_title': custom_title
|
||||
}
|
||||
return _make_request(token, method_url, params=payload, method='post')
|
||||
|
||||
|
||||
@ -679,7 +680,8 @@ def set_chat_permissions(token, chat_id, permissions):
|
||||
method_url = 'setChatPermissions'
|
||||
payload = {
|
||||
'chat_id': chat_id,
|
||||
'permissions': _convert_list_json_serializable(permissions)}
|
||||
'permissions': permissions.to_json()
|
||||
}
|
||||
return _make_request(token, method_url, params=payload, method='post')
|
||||
|
||||
|
||||
|
@ -553,3 +553,8 @@ class TestTeleBot:
|
||||
tb.process_new_updates([update])
|
||||
time.sleep(1)
|
||||
assert update.message.text == 'got' * 2
|
||||
|
||||
def test_chat_permissions(self):
|
||||
tb = telebot.TeleBot(TOKEN)
|
||||
permissions = types.ChatPermissions(can_send_messages=True, can_send_polls=False)
|
||||
msg = tb.set_chat_permissions(CHAT_ID, permissions)
|
||||
|
Loading…
Reference in New Issue
Block a user