Answer the question
In order to leave comments, you need to log in
Why is it impossible to issue a mute for a while using the Telegram bot python?
chat_id = (ID чата)
user_id = message.from_user.id
clock = datetime.now(timezone.utc).timestamp()+1000
print(clock)
req = f'https://api.telegram.org/bot(Токен)/restrictChatMember'
permissions = {'can_send_messages':False, 'can_invite_users': True, 'until_date':clock}
permissions_json = json.dumps(permissions)
params = {'chat_id': chat_id, 'user_id': user_id, 'permissions': permissions_json}
response = requests.post(req, json=params)
print(response.text)
Answer the question
In order to leave comments, you need to log in
Where did you even get until_date from ? This is not
in the
UPD documentation
. Reviewed again. You're just inserting until_date in the wrong place. This is not an object to insert into JSON, but as a separate parameter. Insert in params, and remove from permissions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question