易于使用的python模块,允许将webhook发送到不协调的服务器。
Discord-Webhooks的Python项目详细描述
#python的discord webhooks
[![构建状态](https://travis-ci.org/jamesives/discord-webhooks.svg?branch=master)(https://travis-ci.org/jamesives/discord-webhooks)[![问题](https://img.shields.io/github/issues/jamesives/discord webhooks.svg)(https://github.com/jamesives/discord webhooks/issues)
python的简单模块,允许将webhooks发送到[不协调服务器](https://discordapp.com/)。
通过pip项目。
````
$pip安装Discord Webhooks
````
您必须将从discord频道获取的[webhook url作为参数传入(https://support.discordapp.com/hc/en-us/articles/228383668 intro to webhooks)。
`` python
从discord撸webhooks导入discordwebhooks
您的discord频道的webhook url。
webhook撸url='http://discord.gg/…'
初始化webhook类并附加数据。
webhook=discordwebhooks(webhook撸url)
为基本消息设置一些内容。
webhook.set撸content(content='mont埃祖玛!
触发发送到discord的有效负载。
>webhook.send()
```
webhook.webhook.send()
```python
``从discord的webhooks导入discordcrdwebhooks
webhook.webhook
webhook.webhook-url='http://discord.gg/..'
webhook.webhook.webhook.webhook.webhook.web-url=='hook=不协调网络ooks(webhook_url)
webhook.set_content(content='有史以来最好的猫是…',title='Montezuma!',description='说真的!',\
url='http://github.com/jamesives',color=0xf58cba,timestamp='2018-11-09t04:10:42.039z')
s=460&v=4')
s=460&v=4')
s=460&v=4')
s=460&v=4')
webhook.send()
```
--
|` string`
`title`在邮件附件上显示标题。|` string`
`description`显示邮件附件的说明。|` string`
`url`在标题上创建链接。|` string`
`color`在邮件附件的左侧显示彩色条带。这应该是一个十六进制值,例如"0xf58cba"。|` integer`
`timestamp`在邮件附件下面显示时间戳。必须是有效的时间戳,请考虑使用python的"datetime"来实现localtime。|`字符串`
--
|` string`
`url`在作者姓名上创建链接。|`字符串`
` icon _url`显示作者图标,必须解析为有效的图像路径。|`字符串`
--
|参数说明键入
---------------
`text`应显示在页脚中的文本。|`字符串`
` icon _url`显示页脚图标,必须解析为有效的图像路径。|`
<35<35 <35<35<35<35<35<35<35<35<35<<
参数描述类型
`string`
--
#####`使用"set-image"可以将图像附加到邮件附件中。
<
参数描述类型
:-:-:-:-:-
"url
_field`
使用"add_field"可以附加邮件附件的字段。可以根据需要添加任意多个字段。
|` string`
` value``字段的值。|` string`
`inline`确定字段是否应显示inline,这主要用于有多个字段时的格式化。|`布尔型`
--
[![构建状态](https://travis-ci.org/jamesives/discord-webhooks.svg?branch=master)(https://travis-ci.org/jamesives/discord-webhooks)[![问题](https://img.shields.io/github/issues/jamesives/discord webhooks.svg)(https://github.com/jamesives/discord webhooks/issues)
python的简单模块,允许将webhooks发送到[不协调服务器](https://discordapp.com/)。
通过pip项目。
````
$pip安装Discord Webhooks
````
您必须将从discord频道获取的[webhook url作为参数传入(https://support.discordapp.com/hc/en-us/articles/228383668 intro to webhooks)。
`` python
从discord撸webhooks导入discordwebhooks
您的discord频道的webhook url。
webhook撸url='http://discord.gg/…'
初始化webhook类并附加数据。
webhook=discordwebhooks(webhook撸url)
为基本消息设置一些内容。
webhook.set撸content(content='mont埃祖玛!
触发发送到discord的有效负载。
>webhook.send()
```
webhook.webhook.send()
```python
``从discord的webhooks导入discordcrdwebhooks
webhook.webhook
webhook.webhook-url='http://discord.gg/..'
webhook.webhook.webhook.webhook.webhook.web-url=='hook=不协调网络ooks(webhook_url)
webhook.set_content(content='有史以来最好的猫是…',title='Montezuma!',description='说真的!',\
url='http://github.com/jamesives',color=0xf58cba,timestamp='2018-11-09t04:10:42.039z')
s=460&v=4')
s=460&v=4')
s=460&v=4')
s=460&v=4')
webhook.send()
```
--
|` string`
`title`在邮件附件上显示标题。|` string`
`description`显示邮件附件的说明。|` string`
`url`在标题上创建链接。|` string`
`color`在邮件附件的左侧显示彩色条带。这应该是一个十六进制值,例如"0xf58cba"。|` integer`
`timestamp`在邮件附件下面显示时间戳。必须是有效的时间戳,请考虑使用python的"datetime"来实现localtime。|`字符串`
--
|` string`
`url`在作者姓名上创建链接。|`字符串`
` icon _url`显示作者图标,必须解析为有效的图像路径。|`字符串`
--
|参数说明键入
---------------
`text`应显示在页脚中的文本。|`字符串`
` icon _url`显示页脚图标,必须解析为有效的图像路径。|`
<35<35 <35<35<35<35<35<35<35<35<35<<
参数描述类型
`string`
--
#####`使用"set-image"可以将图像附加到邮件附件中。
<
参数描述类型
:-:-:-:-:-
"url
_field`
使用"add_field"可以附加邮件附件的字段。可以根据需要添加任意多个字段。
|` string`
` value``字段的值。|` string`
`inline`确定字段是否应显示inline,这主要用于有多个字段时的格式化。|`布尔型`
--