一架蟒蛇3号卫生间模块
Wh的Python项目详细描述
whpy-webhook python
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)