-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPI.py
27 lines (14 loc) · 857 Bytes
/
API.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import datetime
from NetworkWorker import network_worker
def send_message(bot, **kwargs):
return network_worker(bot.send_message, False, **kwargs)
def restrict_chat_member(bot, pass_exception=False, **kwargs):
return network_worker(bot.restrict_chat_member, pass_exception, **kwargs)
def delete_message(bot, chat_id, message_id, **kwargs):
return network_worker(bot.delete_message, False, chat_id=chat_id, message_id=message_id, **kwargs)
def get_chat_member(bot, chat_id, user_id):
return network_worker(bot.get_chat_member, False, chat_id=chat_id, user_id=user_id)
def kick_chat_member(bot, chat_id, user_id, until_date):
return network_worker(bot.kick_chat_member, False, chat_id=chat_id, user_id=user_id, until_date=until_date)
def use_custom_api_method(func, **kwargs):
return network_worker(func, False, **kwargs)