通过slack中的斜杠命令执行trello操作

slack_to_trello的Python项目详细描述


Build Status

通过slack中的斜杠命令执行trello操作

当前迭代是概念的证明;目前只支持1个slack团队、1个trello用户和1个trello列表。将来,我们希望通过与trello的oauth集成(将slack用户连接到trello用户)和一些选择板的机制(从slack或服务器上的映射)来支持多个团队和板。

转换

/trello slash command

进入

/trello response message

开始

要获得slack-to-trello运行的副本,请执行以下步骤:

# Clone our repository
git clone https://github.com/underdogio/slack-to-trello
cd slack-to-trello/

# Install our dependencies
pip install -r requirements.txt

# Install our module as a dependency of itself (meta)
python setup.py develop

# The remaining steps are for setting up our configuration
# We will be building `slack_to_trello/config/env`
# We start by copying `env.test`
cp slack_to_trello/config/env.test slack_to_trello/config/env

# Create 2 Slack integrations (1 for receiving slash commands, 1 for sending messages)
# First Slack integration: Slash Commands
#   Open your browser to Slash Commands
#   https://my.slack.com/services/new/slash-commands
#   Command: "/trello"
#   URL: "https://my-server/slack/message"
#     Please replace `my-server` with your server location
#     Don't forget to host it on HTTPS
#   Method: "POST"
#   Token: Provided by Slack
#   Autocomplete -> Description: "Add a Trello card on the Engineering board"
#   Autocomplete -> Help text: "[card subject]"
#   Descriptive Label: "slack-to-trello"
#   Click "Save Integration"
# Once saved, add the "Token" field as `SLACK_TOKEN` into `env`
#   `export SLACK_TOKEN=token_from_slack`
# Second Slack integration: Incoming WebHooks
#   These will be replies upon successful Trello card additions
#   Open your browser to Incoming WebHooks
#   https://my.slack.com/services/new/incoming-webhook
#   Post to Channel: Pick any channel -- we will always be overriding this
#   Webhook URL: Provided by Slack
#   Descriptive Label: "slack-to-trello messages"
#   Customize Name: "slack-to-trello"
#   Customize Icon: Pick any you like -- we recommend `:signal_strength:`
#   Click "Save Settings"
# Once saved, add the "Webhook URL" field as `SLACK_MESSAGE_URL` into `env`
#   `export SLACK_MESSAGE_URL=https://hooks.slack.com/services/path/to/reply`
# Set up our Trello integration
#   We recommend creating a bot user as all cards
#   will be marked as "Created by" the chosen user
# Collect our Trello API information
#   Open our browser to https://trello.com/app-key
#   Save "Key" as `TRELLO_API_KEY` in `env`
#   `export TRELLO_API_KEY=value_from_key`
# Generate a permanent Trello API token (this can be disabled later on)
#   Using the "Key" as "TRELLO_API_KEY" and "Secret" as "TRELLO_API_SECRET"
TRELLO_API_KEY=key_from_website TRELLO_API_SECRET=secret_from_website bin/generate-trello-tokens.py
#   You will be prompted to open a link
#   Follow the link and click "Accept"
#   Copy the standalone value from the page
#   Go back to the command line and enter "y"
#   You will be prompted for a PIN
#   Paste the value from the page
#   You will be given an `oauth_token` and `oauth_token_secret` value
# Save `oauth_token` as `TRELLO_TOKEN` in `env`
#   `export TRELLO_TOKEN=value_from_oauth_token`
# Find the board/list we want to add cards to
# List our boards and their ids via:
bin/list-trello-boards.py [TRELLO_API_KEY][TRELLO_TOKEN]# Find the board we want and record its id as `TRELLO_BOARD_ID` in `env`
#   `export TRELLO_BOARD_ID=target_board_id`
# Output the board lists and their ids via:
bin/list-trello-board-lists.py [TRELLO_API_KEY][TRELLO_TOKEN][TRELLO_BOARD_ID]# Find the list we want and record its id as `TRELLO_LIST_ID` in `env`
#   `export TRELLO_LIST_ID=target_board_id`
# Start our server (default port is 5000)
./run.sh
# An alternative port can be chosen via the `PORT` environment variable
# PORT=6000 ./run.sh
# You should now be able to send a `/trello` command in Slack

文档

测试

我们的测试是通过nosetests支持的,但是需要在手动操作之前设置特定的环境变量。要运行我们的测试,请执行以下步骤:

# Install our development dependencies
pip install -r requirements-dev.txt

# Run our tests
./test.sh

贡献

代替正式的形式指南,注意保持现有的编码风格。为任何新的或更改的功能添加单元测试。通过./test.sh进行测试。

许可证

版权所有(c)2015 underdog.io

根据麻省理工学院的许可证。

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

推荐PyPI第三方库


热门话题
如何使用Java中的扫描仪读取文本文件中的特定字符?   java如果我们在hibernate中开始事务但不提交它,会发生什么?   Azure CosmosDB Java Springboot中的无服务器帐户不支持spring boot设置提供吞吐量或容器自动导航   附加到新对象的Java注释?   java如何将自定义文本视图添加到。在Kotlin中添加通知操作   java Shibboleth添加_OpenSAMLcookies,导致HTTP头大小>8k   分布式传感器数据(~40Hz)的高效Java观测器设计   java如何在while循环外声明数组,但在while循环中初始化它?   用@XmlElementRef注释的java元素没有显示在JAXB编组字符串中?   java替换二维数组的值   java如何在任务栏上创建Windows7加载栏   java如何在组件注释bean中使用会话或RequestScope bean?   java netbeans freermarker插件错误:在实现版本中请求netbeans桥的插件Lexer   java谷歌地图方向。加载失败,返回服务器错误   java当我试图递归地计算两个值之间的整数之和时,为什么结果返回一个奇怪的值?   java如何通过html文件的用户获取运行时输入,以使用Jsoup进行解析?