一架蟒蛇3号卫生间模块

Wh的Python项目详细描述


whpy-webhook python

PyPIPyPI - LicensePyPI - Python VersionPyPI - Downloads

webhook python是一个python 3模块,用于通过已建立的webhook与各种聊天应用程序进行交互。

安装

pip install WhPy

SHA256校验和

29fecc82d25a71d9b3cd80c2bf4551e27c8b8e414c203b135b641fd4235d0c92  WhPy/discord.py
2004c330f131d71e4f3556f2ce3b737208403789a8e30314d67c702805b43def  WhPy/__init__.py

代码示例

你好,世界!

fromWhPyimportdiscord# Discord Webhook URLwebhook_url="https://discordapp.com/api/webhooks/1234/567890"# Creates Discord Instancehook=discord.Webhook(url=webhook_url)# Sets Message Contenthook.message(content="Hello, World!")# Executes the Webhookhook.execute()

你好,世界!来自用户MichaelCduBois

fromWhPyimportdiscord# Discord Webhook Parameterswebhook_channel_id="1234"webhook_token="567890"# Creates Discord Instancehook=discord.Webhook(channel_id=webhook_channel_id,token=webhook_token)# Sets Message Content as MichaelCduBoishook.message(content="Hello, World!",username="MichaelCduBois")#Executes the Webhookhook.execute()

你好,世界!文本到语音信息

fromWhPyimportdiscord# Discord Webhook URLwebhook_url="https://discordapp.com/api/webhooks/1234/567890"# Creats Discord Instancehook=discord.webhook(url=webhook_url)# Sets Message content as a Text-to-Speech Messagehook.message(content="Hello, World!",tts=True)# Executes the Webhookhook.execute()

返回消息确认为json对象

fromWhPyimportdiscord# Discord Webhook URLwebhook_url="https://discordapp.com/api/webhooks/1234/567890"# Creats Discord Instancehook=discord.webhook(url=webhook_url)# Sets Message Contenthook.message(content="Hello, World!")# Executes the Webhookhook.execute(wait=True)

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

推荐PyPI第三方库


热门话题
Java:不解析XML的简单XML。例外   KIE Workbench的java自定义UI   java将元素从bucket移动到LinkedList,但有一个元素被完全删除   如何将java stream collect转换为scala   java运行AsynkTask多次不工作   java组织。xml。萨克斯。SAXParseException:cvccomplextype。2.4.c:匹配的通配符是严格的   java是一种计算排序算法所需时间的合适方法   java在O(logn)时间内对排序整数数组中具有相同数字的数字进行计数   xpages从当前数据库javaAgent调用另一个数据库的javaAgent   java如何在instagram中上传特定位置的所有照片   JavaApachePOI可以有效地删除多个列   java创建的对象数   java我可以在关闭连接时关闭Oracle JDBC自动提交吗?