Python中电报botapi的异步API包装器

telegram.p的Python项目详细描述


^{1}$ 在

在电报.py在

PyPIPyPI - Python VersionDocumentation StatusGitHub - LicenseTelegram Channel

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.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java从JSP或HTML向servlet发送多个参数   java方法来查看字符是否在字符数组中   使用带有java的MAC地址连接到设备   java如何将csv文件中的数据打印到secondactivity?   java如何从netbean 7.0.1连接到数据库   java考虑所有可能的类值,用于输出测试分割的预测值。   java我的actionListener调用有什么问题   swing在Java中实现粒子过滤器最有效的方法是什么?   java运行。getFontFamily()为返回null。使用apachepoi的docx文件   一个事务中的java领域循环与每个步骤循环中的一个事务   java日期格式与Spring Boot不兼容   java类冲突。处理   java GridBagLayout不工作   java将图像发送到另一个应用程序