库和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许可条款发布的免费软件。
有关详细信息,请参阅源发行版附带的许可证文件。
联系人
- 马西米利亚诺·托罗米奥massimiliano.torromeo@gmail.com>;