库和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 testcontainers maven构建失败   java实现jacobi算法实现laplace方程   java中的多线程:如何在不等待所有线程使用ExecutorService完成任务的情况下终止所有线程的执行?   java Hello World不在Android Studio 3中工作   ubuntu Tomcat7的Java版本不正确   java Javafx内存泄漏   对于手动实现的Spring数据存储库方法,我应该使用Java8默认方法吗?   googleappengine中的java添加过滤查询   html当使用JSOUP库在Java中读取标签时,如何保留标签(如<br>、<ul>、<li>、<p>等)的含义?   编码为什么jasper生成的报告在Java中不显示西里尔语(保加利亚语)?   java有没有办法隐藏当前位置和jdk动作?   java找出编译原型文件的版本   有没有办法在运行时更改java方法的访问修饰符?   语法字符串。。。Java中的参数   java数组元素在添加其他元素时会相互覆盖   eclipse中的java GWT项目   java如何为spring rest模板请求将动态json属性名映射到jackson   java无法在Windows 10上找到特定的JDK   在xml字符串和java字符串之间提取正则表达式子字符串