库和cli实用程序将消息发送到mattermost的传入webhook

mattersend的Python项目详细描述


用于向mattermost(http://www.mattermost.org/)的传入webhook发送消息的cli工具。

帮助

usage: mattersend [-h] [-V] [-C CONFIG] [-s SECTION] [-c CHANNEL] [-U URL]
                  [-u USERNAME] [-i ICON] [-t [DIALECT] | -y SYNTAX] [-n]
                  [-f FILE]

Sends messages to mattermost's incoming webhooks via CLI

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -C CONFIG, --config CONFIG
                        Use a different configuration file
  -s SECTION, --section SECTION
                        Configuration file section
  -c CHANNEL, --channel CHANNEL
                        Send to this channel or @username
  -U URL, --url URL     Mattermost webhook URL
  -u USERNAME, --username USERNAME
                        Username
  -i ICON, --icon ICON  Icon
  -t [DIALECT], --tabular [DIALECT]
                        Parse input as CSV and format it as a table (DIALECT
                        can be one of sniff, excel, excel-tab, unix)
  -y SYNTAX, --syntax SYNTAX
  -n, --dry-run, --just-print
                        Don't send, just print the payload
  -f FILE, --file FILE  Read content from FILE. If - reads from standard input
                        (DEFAULT: -)

配置文件

开始向mattermost发送消息的唯一必需选项是webhook url。 您可以在配置文件中(在/etc/mattersend.conf中全局设置,或在$home/.mattersend.conf中本地设置)或在cli上使用–url参数指定它。

您可以有多个部分来覆盖默认设置,然后使用–section参数从cli中选择它们。

这是mattersend的配置文件示例:

[DEFAULT]
url = https://mattermost.example.com/hooks/XXXXXXXXXXXXXXXXXXXXXXX
icon = :ghost:
username = This is a bot
channel = @myself

[angrybot]
icon = :angry:
username = AngryBot

示例用法

echo "Hello world!" | mattersend -U https://mattermost.example.com/hooks/XXX

# you can omit -U with mattersend.conf
echo "Hello world!" | mattersend

# send file content
mattersend -f todo.txt

# table data
echo -e "ABC;DEF;GHI\nfoo;bar;baz" | mattersend -t

许可证

版权所有(c)2016 Massimiliano Torromeo

mattersend是根据bsd许可条款发布的免费软件。

有关详细信息,请参阅源发行版附带的许可证文件。

联系人

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

推荐PyPI第三方库


热门话题
java在Android应用内小部件中显示之前停止活动   swing如何在java文本字段中添加文本而不是替换文本   java相对布局getParams和setMargin不工作   java处理JDBC中Oracle的“本地时区时间戳”数据类型   ArrayList的java空指针异常   java无法使用跨不同机器生成的访问令牌进行身份验证   for循环中的java后缀和前缀   java验证方法未运行Mockito   java如何防止从其他网站调用我的servlet   java需要您的帮助来理解Android中的更新状态点   java使用纬度和经度获取时区   java httpURLConnection:post参数可以有多长?   java如何将执行的GROOVY脚本结果返回到RESTAPI响应   java为什么不同的线程输入了两次“synchronized(lock)”?   java在使用springsecurity和springwebflux时禁用WebSession创建   java如何解决“itemTag无法解析或不是字段”?   Java静态和动态绑定、重载   java为什么instanceof听上去不工作?   java登录到外部站点?(安卓)