Coder Social home page Coder Social logo

williambergamin / python-slack-hooks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from slackapi/python-slack-hooks

0.0 0.0 0.0 57 KB

Helper library implementing the contract between the Slack CLI and Bolt for Python

Home Page: https://pypi.org/project/slack-cli-hooks/

License: MIT License

Shell 5.18% Python 94.82%

python-slack-hooks's Introduction

Python Slack Hooks

PyPI - Version Python Versions Codecov

This library defines the contract between the Slack CLI and Bolt for Python.

Overview

This library enables inter-process communication between the Slack CLI and applications built with Bolt for Python.

When used together, the CLI delegates various tasks to the Bolt application by invoking processes ("hooks") and then making use of the responses provided by each hook's stdout.

For a complete list of available hooks, read the Supported Hooks section.

Requirements

The latest minor version of Bolt v1 is recommended.

Usage

A Slack CLI-compatible Slack application includes a ./slack.json file that contains hooks specific to that project. Each hook is associated with commands that are available in the Slack CLI. By default, get-hooks retrieves all of the supported hooks and their corresponding scripts as defined in this library.

The CLI will always use the version of the python-slack-hooks that is specified in the project's requirements.txt.

Supported Hooks

The hooks currently supported for use within the Slack CLI include check-update, doctor, get-hooks, get-manifest, and start:

Hook Name CLI Command File Description
check-update slack update check_update.py Checks the project's Slack dependencies to determine whether or not any libraries need to be updated.
doctor slack doctor doctor.py Returns runtime versions and other system dependencies required by the application.
get-hooks All get_hooks.py Fetches the list of available hooks for the CLI from this repository.
get-manifest slack manifest get_manifest.py Converts a manifest.json file into a valid manifest JSON payload.
start slack run start.py While developing locally, the CLI manages a socket connection with Slack's backend and utilizes this hook for events received via this connection.

Overriding Hooks

To customize the behavior of a hook, add the hook to your application's /slack.json file, and provide a corresponding script to be executed.

When commands are run, the Slack CLI will look to the project's hook definitions and use those instead of what's defined in this library, if provided.

Below is an example /slack.json file that overrides the default start:

{
  "hooks": {
    "get-hooks": "python3 -m slack_cli_hooks.hooks.get_hooks",
    "start": "python3 app.py"
  }
}

Contributing

Contributions are always welcome! Please review the contributing guidelines for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.