Click#

clicky.frontends.click.become_clicky(*, command: str = 'clicky', help: str = '\nClicky turns your Click-based CLI application into a bot.\n', config: Configuration | Callable[[], Configuration])#

Wraps a Click-based CLI application, creating a “clicky” command which can be used to start a slack bot that exposes the CLI.

Example#
 1  import click
 2  from clicky.frontends.click import become_clicky
 3
 4  @become_clicky(
 5      config={
 6          "servers": {
 7              "my_slack_server": {
 8                  "bot": "slack",
 9                  "prefix": "!hello",
10                  "tokens": {
11                      "app": "<app_token>",
12                      "bot": "<bot_token>"
13                  }
14              }
15          },
16          "whitelist": [
17              {
18                "on": "my_slack_server",
19                "type": "user",
20                "id": "TkTech",
21                "commands": [".*"]
22              }
23          ]
24      }
25  )
26  @click.command()
27  def cli():
28      click.echo('Hello, world!')
29
30  if __name__ == '__main__':
31      cli()