Python中电报botapi的异步API包装器
telegram.p的Python项目详细描述
^{1}$ 在
在电报.py在
Python中Telegram-bot-API的异步API包装器
安装
安装和使用python3.7+需要电报.py. 在
从PyPI安装最新版本:
# Mac/Linux python3 -m pip install telegram.py # Windows py -3 -m pip install telegram.py
或者从GitHub安装开发版本:
^{pr2}$简单的例子
importloggingimporttelegrampyfromtelegrampy.extimportcommandslogging.basicConfig(level=logging.INFO,format="(%(asctime)s) %(levelname)s%(message)s",datefmt="%m/%d/%y - %H:%M:%S %Z")logger=logging.getLogger("telegrampy")bot=commands.Bot("token here")@bot.command()asyncdefhi(ctx):awaitctx.send("Hello")bot.run()
有关此示例的逐行演练,请参见quickstart。在
文件
Documentation can be found here.
- 项目
标签: