一架蟒蛇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字符串。替换(regex,string)以替换XML中的内容   java Spring SOAP Web服务请求日志中XML请求有效负载的元素   java在一个类中保存作业对象并在另一个类中使用(初学者)   java无法定位com。西蒙图夫斯。奥内贾尔。在web启动中启动   java可以将Spring DAO合并到服务层吗?   使用互相关的声音文件的java时间延迟   java理解C中声明的数组指针算法   regex如何在Java中找到第一个未替换的引号?   当存在插入Spring数据JPA时进行java数据库轮询   java Axis客户端调用引发classcast异常   JavaFX ControlFX对话框中的java动作按钮css样式   使用iText Java获取空页计数   返回随机文本字段输入的java   java从spring boot stomp连接到外部activemq   java控制台错误无法找到或加载主类   java NoClassDefFoundError在尝试使用JarSigner对apk文件进行签名时出错。exe   GuavaJava:对象列表到字符串列表的可能转换   java PropertyPlaceHolderConfiguration和ResourceBundleMessageSource   java无法在回调中赋值   用于旋转变换的java简洁类(减少冗余)