Python 我有一个带有我自己代码的单电报机器人,我没有使用任何包装器。现在,我想在我的bot中实现async,有人为此提供了示例async库吗?
我有一个带有我自己代码的单电报机器人,我没有使用任何包装器。现在,我想在我的bot中实现async,有人为此提供了示例async库吗 类电报\u chatbot():Python 我有一个带有我自己代码的单电报机器人,我没有使用任何包装器。现在,我想在我的bot中实现async,有人为此提供了示例async库吗?,python,asynchronous,bots,telegram,Python,Asynchronous,Bots,Telegram,我有一个带有我自己代码的单电报机器人,我没有使用任何包装器。现在,我想在我的bot中实现async,有人为此提供了示例async库吗 类电报\u chatbot(): 没有答复顺便说一句,谢谢你的帮助 def __init__(self, token): self.token = token self.base = "https://api.telegram.org/bot{}/".format(self.token) def get_updates(sel
没有答复顺便说一句,谢谢你的帮助
def __init__(self, token):
self.token = token
self.base = "https://api.telegram.org/bot{}/".format(self.token)
def get_updates(self, offset=None):
url = self.base + "getUpdates?timeout=100"
if offset:
url = url + "&offset={}".format(offset + 1)
r = requests.get(url)
return json.loads(r.content)