1
0
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:
Badiboy 2020-05-20 11:57:41 +03:00
parent dbff7cbb3e
commit 32dc03ec44
2 changed files with 9 additions and 2 deletions

View File

@ -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')

View File

@ -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)