{"id":18377486,"url":"https://github.com/lightning-universe/slack-command-bot-component","last_synced_at":"2025-04-06T21:31:36.835Z","repository":{"id":58135138,"uuid":"530079430","full_name":"Lightning-Universe/Slack-Command-Bot-component","owner":"Lightning-Universe","description":"With this component you can create a Slack bot and enable interactivity with the Slash Commands.","archived":true,"fork":false,"pushed_at":"2024-07-01T21:50:09.000Z","size":323,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-01T18:47:02.884Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lightning-Universe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-29T05:34:38.000Z","updated_at":"2024-10-04T09:29:26.000Z","dependencies_parsed_at":"2024-04-01T21:48:00.424Z","dependency_job_id":null,"html_url":"https://github.com/Lightning-Universe/Slack-Command-Bot-component","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lightning-Universe%2FSlack-Command-Bot-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lightning-Universe%2FSlack-Command-Bot-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lightning-Universe%2FSlack-Command-Bot-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lightning-Universe%2FSlack-Command-Bot-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lightning-Universe","download_url":"https://codeload.github.com/Lightning-Universe/Slack-Command-Bot-component/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247555174,"owners_count":20957719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T00:28:17.388Z","updated_at":"2025-04-06T21:31:36.551Z","avatar_url":"https://github.com/Lightning-Universe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack_command_bot component\n\n\u003cimg src=\"https://i.ibb.co/KL4ML46/slack-bot.jpg\"\u003e\n\nWith this app you can create a Slack bot and enable interactivity with the Slash Commands.\nIt can recieve slash commands and send message or files with the Slack client API.\n\n## How to Run Slack Command Bot\n\nFirst, install slack_command_bot (warning: this component has not been officially approved on the lightning gallery):\n\n```bash\nlightning install component git+https://github.com/Lightning-AI/LAI-slack-messenger.git@main\n```\n\nOnce the app is installed, use it in an app:\n\n```python\nfrom slack_command_bot import SlackCommandBot\nimport lightning as L\nimport slack\nfrom flask import request\n\n\nclass DemoSlackCommandBot(SlackCommandBot):\n    def handle_command(self):\n        \"\"\"Customize this method the way you want your bot to interact with the prompt.\"\"\"\n        client = slack.WebClient(token=self.bot_token)\n        data: dict = request.form\n        channel_id = data[\"channel_id\"]\n\n        client.chat_postMessage(text=\"testing post msg\", channel=channel_id)\n        return \"Hey there! command was received successfully\", 200\n\n\nclass LitApp(L.LightningFlow):\n    def __init__(self) -\u003e None:\n        super().__init__()\n        self.slack_bot = DemoSlackCommandBot(command=\"/LAIcommand\")\n\n    def run(self):\n        print(\n            \"this is a simple Lightning app to verify your component is working as expected\"\n        )\n        self.slack_bot.run()\n\n\napp = L.LightningApp(LitApp())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightning-universe%2Fslack-command-bot-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightning-universe%2Fslack-command-bot-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightning-universe%2Fslack-command-bot-component/lists"}