{"id":13409441,"url":"https://github.com/innogames/slack-bot","last_synced_at":"2025-05-16T18:07:13.264Z","repository":{"id":35445594,"uuid":"197727583","full_name":"innogames/slack-bot","owner":"innogames","description":"Ready to use Slack bot for lazy developers: start Jenkins jobs, watch Jira tickets, watch pull requests with AI support...","archived":false,"fork":false,"pushed_at":"2025-04-11T13:12:20.000Z","size":9464,"stargazers_count":192,"open_issues_count":8,"forks_count":46,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T14:31:08.444Z","etag":null,"topics":["bitbucket","bot","chatgpt","dall-e","github","gitlab","go","golang","jenkins","jira","openai","pull-request","slack","slack-bot","slackbot","slackbots"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/innogames.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,"zenodo":null}},"created_at":"2019-07-19T07:49:06.000Z","updated_at":"2025-04-10T16:52:33.000Z","dependencies_parsed_at":"2023-02-18T08:16:05.706Z","dependency_job_id":"3e347afe-18e7-48b4-a900-990af9d17c33","html_url":"https://github.com/innogames/slack-bot","commit_stats":{"total_commits":579,"total_committers":13,"mean_commits":44.53846153846154,"dds":0.6062176165803108,"last_synced_commit":"8afc963c98d8ef1b426feba7e8917779e029feac"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innogames%2Fslack-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innogames%2Fslack-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innogames%2Fslack-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innogames%2Fslack-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/innogames","download_url":"https://codeload.github.com/innogames/slack-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248607171,"owners_count":21132487,"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":["bitbucket","bot","chatgpt","dall-e","github","gitlab","go","golang","jenkins","jira","openai","pull-request","slack","slack-bot","slackbot","slackbots"],"created_at":"2024-07-30T20:01:00.831Z","updated_at":"2025-04-12T17:40:08.962Z","avatar_url":"https://github.com/innogames.png","language":"Go","readme":"# Slack Bot\nThis Slack bot improves the workflow of development teams. Especially with focus on Jenkins, GitHub, GitLab and Jira, as the integration is working out of the box.\nBut also custom commands, macros, crons and other project specific commands can be implemented in a simple and flexible way.\n\n[![Actions Status](https://github.com/innogames/slack-bot/workflows/Test/badge.svg)](https://github.com/innogames/slack-bot/actions)\n[![PkgGoDev](https://pkg.go.dev/badge/innogames/slack-bot.v2)](https://pkg.go.dev/github.com/innogames/slack-bot/v2/)\n[![Go Report Card](https://goreportcard.com/badge/github.com/innogames/slack-bot)](https://goreportcard.com/report/github.com/innogames/slack-bot)\n[![Release](https://img.shields.io/github/release/innogames/slack-bot.svg)](https://github.com/innogames/slack-bot/releases)\n[![codecov](https://codecov.io/gh/innogames/slack-bot/branch/master/graph/badge.svg)](https://codecov.io/gh/innogames/slack-bot)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Docker](https://img.shields.io/docker/pulls/brainexe/slack-bot.svg)](https://hub.docker.com/r/brainexe/slack-bot)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\n# Installation\n## 1st) Create+prepare the Slack App:\n### Use Manifest file as App template\n1. Create a [Slack App](https://api.slack.com/apps?new_app=1) (press \"Press \"Create New App\"\")\n2. Select \"From an app manifest\"\n3. Select your Workspace\n4. Paste this Yaml code:\n\u003cdetails\u003e\n    \u003csummary\u003eClick to expand!\u003c/summary\u003e\n\n```yaml\n_metadata:\n  major_version: 1\n  minor_version: 1\ndisplay_information:\n  name: slack_bot\n  background_color: \"#382e38\"\nfeatures:\n  app_home:\n    messages_tab_enabled: true\n    messages_tab_read_only_enabled: false\n  bot_user:\n    display_name: bot\n    always_online: true\noauth_config:\n  scopes:\n    bot:\n      - app_mentions:read\n      - channels:read\n      - channels:history\n      - groups:history\n      - chat:write\n      - im:history\n      - im:write\n      - mpim:history\n      - reactions:read\n      - reactions:write\n      - users:read\n      - files:read\n      - pins:write\nsettings:\n  event_subscriptions:\n    bot_events:\n      - app_mention\n      - message.im\n  interactivity:\n    is_enabled: true\n  org_deploy_enabled: false\n  socket_mode_enabled: true\n  token_rotation_enabled: false\n```\n\u003c/details\u003e\n\n5. Create the App!\n6. \"Basic information\" → \"Display Information\" → Upload Image (512px+!) + Set a proper name\n7. \"App Home\" → \"Show Tabs\" → Check \"Allow users to send Slash commands and messages from the messages tab\"\n8. \"Basic Information\" → \"App-Level Tokens\" -\u003e \"Generate Token and scopes\" -\u003e use \"bot token\" as token name and \"connections:write\" as scope\n8. You will see an App-Level Token (beginning with xapp-). Set it in the config.yaml as \"slack.socket_token\".\n9. Basic Information → \"Request to install\" + \"Install to Workspace\" continue there\n10. Then you will get another token (displayed in \"Install App\" tab), starting with \"xoxb-\". Use it as \"slack.token\" in the config.yaml\n11. In your slack client you can add the bot now in any channel or start a private conversation.\n\n\n## 2nd) Prepare the config\n\nFirst prepare the `config.yaml`, just take a look at [config-example.yaml](./config.example.yaml)\n- at least the Slack token+socket-token are required) or take a look in config-example.yaml\n\n\n## 3rd) Run the bot\n\n### Option 1: run via go\n1. [install go (at least 1.22)](https://go.dev/doc/install)\n2. create a config.yaml (at least the Slack token+socket-token are required) or take a look in config-example.yaml\n3. `go run github.com/innogames/slack-bot/v2/cmd/bot`\n\n### Option 2: via Docker\n1. [install Docker incl. docker-compose](https://docs.docker.com/get-docker/)\n2. clone this repo or at least fetch the docker-compose.yaml\n3. add your Slack user id or user name in the \"allowed_users:\" section of the config.yaml\n4. `docker-compose up`\n\n### Option 3: Advanced: when planning working on the bot core\n1. [install go](https://go.dev/doc/install)\n2. clone/fork this repo\n3. run `go run cmd/bot/main.go` or `make run` to run the go application\n\n\n# Usage\nAs Slack user, you just have to send a private message to the bot user/app containing the command to execute.\nAdditionally, you can add the Bot to any channel and execute bot commands in it by prefixing your command with @bot_name, e.g. `@slack-bot start job DailyDeployment`\n\n**Note:** You have to invite the bot into the channel to be able to handle commands.\n\n# Bot Commands\n## Help\nThe `help` command just prints a list of all available commands of this bot. \nWith `help *command*` you'll get a short description and some examples for a single command.\n\n![Screenshot](./docs/help.png)\n\n## Jenkins\nThe bot is able to start and monitor Jenkins job in a simple but powerful way.\n\nBy default, the commands are not available and not visible in the \"help\", till the \"jenkins.host\" is defined in the config file.\n\n### Start Jenkins jobs\nThe `start job` command starts a Jenkins job and shows the current progress. **Attention:** only whitelisted jobs in the config are startable!\n\nIn additions, each job can have a configurable `trigger` which make it possible to create custom commands to start jobs. (it's a regexp which takes parameter names into account).\nE.g. \"start daily deployment\" could be the trigger for one Jenkins job. Sending this text to the bot would start the job.\n\nAfter starting a job, the bot will show the estimated build time and some action buttons. There you can open the logs or abort the build directly.\n\nThe bot is also able to parse parameters and lookup branch names using a fuzzy branch search.\n\n**Examples:**\n- `trigger job DeployBeta`\n- `start job BackendTests TEST-123` (search for a full branch name, containing TEST-123. e.g. feature/TEST-123-added-feature-456)\n\n![Screenshot](./docs/jenkins-trigger-1.png)\n\n![Screenshot](./docs/jenkins-trigger-2.png)\n\n### Jenkins build notifications\nThe bot also has the possibility to create one time notifications for Jenkins builds. This might be useful for long-running jobs where the devs are waiting for the result.\n\n**Example:**\n- `inform me about build NightlyTests` (watches the most recent running build)\n- `inform me about build MyJobName #423` (specify a build number)\n- `inform job MyJobName` (alternative syntax)\n\n### Jenkins job notifications\nReceive Slack messages for all process builds for the given job:\n\n**Example:**\n- `watch JenkinsSelfCheck` notifies about any build of Job `JenkinsSelfCheck`\n- `unwatch JenkinsSelfCheck`\n\n### Jenkins status\nSmall command to disable/enable job execution on Jenkins side.\n\n**Example:**\n- `disable job NightlyTests` (disable job on Jenkins)\n- `enable job NightlyTests`\n\n### Jenkins retry\nWhen a build failed you are able to retry any build by:\n\n**Example:**\n- `retry build NightlyTests` (retries the last build of a job)\n- `retry build NightlyTests #100` (retries given build)\n\n### Nodes\n`jenkins nodes` lists all available Jenkins nodes. The online/offline status and number of executors are visible.\n![Screenshot](./docs/jenkins-nodes.png)\n\n\n## Pull Requests\nIf you just paste a link to a GitHub/GitLab/Bitbucket/Stash Pull request, the bot will track the state of the ticket!\n- When a developer was added as reviewer, it will add an \"eyes\" reaction to show other devs that someone is already taking a look\n- When the reviewer approved the ticket, a checkmark is added\n- After merging the pull request, it will add a \"merge\" reaction\n\nYou're also able to set custom \"approved\" reactions. E.g to see directly who or which component/department approved a pull request you can use the name of the reaction or the Unicode character directory\n\u003cdetails\u003e\n    \u003csummary\u003eExpand example!\u003c/summary\u003e\n\n```yaml\npullrequest:\n  reactions:\n    merged: custom_merge_arrow\n    review: 👀\n  custom_approve_reaction:\n    nerdydev: \"approved_backend\"\n    iamamobiledev: \"approved_mobile\"\n    iamamobiledev2: \"approved_mobile\"\n```\n\u003c/details\u003e\n\n![Screenshot](./docs/pull-request.png)\n\n**Extra Features:**\nFor Bitbucket, the bot is able to extract the current build status (e.g. from Jenkins/Bamboo etc) and show failed and running builds (fire reaction) as a reaction (circle arrow reaction). When the build is stable, the build reactions disappear.\n![Screenshot](./docs/pull-request-build-status.png)\n\n## Command Queue\nThe `queue` command (with the alias `then`) is able to queue the given command, until the currently running command finished. \n\nExample following scenario: you have a build job (which might take some minutes) and a deploy job which relies on the build artifacts. Now you can do:\n- `trigger job Build feature1234` to start the Build job with given branch\n- `queue trigger job DeployBranch feature1234` \n- `queue reply Deployment is done!`\n\n**Other example:**\n- `delay 1h`\n- `then send message #backend coffee time?`\n\nTo see all running background commands (like Jenkins jobs or PR watcher) use this command:\n- `list queue`\n\n## Jira\nThe bot is able to query information from Jira, either from a single ticket, or a whole list of tickets.\n\nBy default, the commands are not available and not visible in the \"help\", till the \"jira.host\" is defined in the config file.\n\n**Examples**\n- `jira TEST-1234`\n- `jira 1242` (opens the ticket, using the configured default jira project)\n- `jql type=bug and status=open` (use default project by default)\n- `jira \"Second city\"` (text search of tickets in default project)\n\n![Jira ticket](./docs/jira-single.png)\n\n![Jira list](./docs/jira-list.png)\n\nIt's also possible to get a notification when there is a state change in a certain Jira ticket.\n\n**Example**\n- `watch ticket PROJ-12234`\n\n## Interactions\nIt's possible to create buttons which are performing any bot action when pressing the button.\n[Slack interactions](https://api.slack.com/interactivity/actions)\n\n![Jira list](./docs/interaction.png)\n\n**Examples:**\n - `add button \"Start Deployment\" \"trigger job LiveDeployment\"`\n\n**Note** \n - only whitelisted users can click the button\n - each button is only active once\n  \n## Custom variables\nConfigure user specific variables to customize bot behavior. E.g. each developer has his own server environment.\n\n**Example:** Having this global config:\n```yaml\ncommands:\n  - name: Deploy\n    trigger: \"deploy (?P\u003cbranch\u003e.*)\"\n    commands:\n      - deploy {{.branch}} to {{ customVariable \"defaultServer\" }}\n``` \n\nEach developer can now call ONCE this commands like: `set variable defaultSerer foobarX.local`  to register the custom \"defaultServer\". \n\nWhen now calling `deploy mater`, it will deploy the `master` branch to `foobarX.local` server.\n\n**Another example**\nHere an advanced version which uses [Go templates](https://golang.org/pkg/text/template/).\nIn the end, the command will generate one subcommand, like:\n`reply \u003c!here\u003e demo for \u003chttps://jira.example.com/TEST-1234|TEST-1234: Example-Ticket\u003e` which will post the link to the Slack channel.\n\n```yaml\n  - name: demo\n    trigger: \"demo (?P\u003cticketId\u003e\\\\w+-\\\\d+)\"\n    commands:\n      - |\n        {{ $ticket := jiraTicket .ticketId }}\n        {{ if $ticket }}\n          reply \u003c!here\u003e demo for \u003c{{ jiraTicketUrl $ticket.Key }}|{{ $ticket.Key }}: {{ $ticket.Fields.Summary }}\u003e\n        {{ else }}\n          reply Ticket {{ .ticketId }} not found :white_frowning_face:\n        {{ end }}\n    description: Informs the current channel about a demo of a Jira ticket. It directly posts a link to the ticket\n    examples:\n      - demo XYZ-1232\n```\n    \nUser can define his default environment once by using `set variable serverEnvironment aws-02`.\n\nThen the `deploy feature-123` will deploy the branch to the defined `aws-02` environment.\nEach user can define his own variables.\n\n## Openai/ChatGPT/Dall-e integration\nIt's also possible to have a [ChatGPT](https://chat.openai.com) like conversation with the official OpenAI integration (GPT3.5)!\n\n![openai](./docs/openai.png)\n\nJust type \"openai\" or \"chatgpt\" before your question to create a new thread which behaves like the well-known ChatGPT page. The content of the last 10 messages is used as context.\nTo make it work, a valid \"openai.api_key\" must be provided in the configuration.\n\n**Extended config:**\n```yaml\nopenai:\n  api_key: \"sk-123....789\"\n  initial_system_message: \"You are a Slack bot for Project XYZ, please answer shortly.\"\n  update_interval: '3s' # fewer Slack messages update during generation\n  model: gpt-3.5-turbo\n  temperature: 0.8\n  log_texts: true # opt in: log all input/output text to the log\n```\n\nWhen using the \"openai XXX\" command within a existing thread, the previous messages are used as context for further calls.\n\nIt also possible to use the function in the templates (like in custom commands or crons). \n\n`{{ openai \"Say some short welcome words to @Jon_Doe\"}}` would print something like `Hello Jon, welcome! How can I assist you today?`\n\n### DALL-E integration\n\nThe bot is also able to generate images with the help of [DALL-E](https://openai.com/blog/dall-e/). \nJust prefix you prompt with \"dalle\" and the bot will generate an image based on your text.\n\n![dall-e](./docs/dalle.png)\n\n## Quiz command\nIf you need a small break and want to play a little quiz game, you can do so by calling this command.\nNo more than 50 questions are allowed. \nThe questions are from different categories and difficult levels and are either multiple choice or true/false questions.\n\n**Commands**\n- `quiz 10` to start a quiz with 10 questions \n- `answer 1` to answer a question with the first answer\n\n![Quiz game](./docs/quiz.png)\n\n## Weather command\nIt's possible to setup [OpenWeatherMap](https://openweathermap.org/) to get information about the current weather at your location.\n\n![Screenshot](./docs/weather.png)\n\n**Example config:**\n```yaml\nopen_weather:\n  apikey: \"612325WD623562376678\"\n  location: \"Hamburg, DE\"\n  units: \"metric\"\n```\n\n## Custom command\nEvery user is able to define own command aliases. \nThis is a handy feature to avoid typing the same command every day.\n\n**Example usage**\n- `list commands` to just list the defined commands for the current user\n- `add command 'myCommand' 'trigger job RestoreWorld 7` -\u003e then just call `myCommand` later\n- `add command 'build master' 'trigger job Deploy master ; then trigger job DeployClient master'`\n- `delete command 'build master'`\n- -\u003e then you can execute `myCommand` to trigger this Jenkins job\n![Screenshot](./docs/custom-commands.png)\n\n## Commands\nDefined \"Commands\" (former called \"Macros\") are very magical and can be defined in the yaml configuration files.\n\nThey have a trigger (a regular expression) and have a list of sub commands which will be executed. \nThey take parameter groups from regexp into account - so they can be very flexible!\n\nOne simple example to start two Jenkins jobs with a given branch name at the same time:\n```yaml\ncommands:\n - name: build clients\n   trigger: \"build clients (?P\u003cbranch\u003e.*)\"\n   commands:\n    - \"reply I'll build {{ .branch }} for you\"\n    - \"trigger job BuildFrontendClient {{ .branch }}\"\n    - \"trigger job BuildMobileClient {{ .branch }}\"\n    - \"then reply done! :checkmark:\"\n```\n![Screenshot](./docs/macro-multiple-jobs.png)\n\n**Note**: In the commands, you can use the full set of [template features of go](https://golang.org/pkg/text/template/) -\u003e loops/conditions are possible!\n\n### Template functions\nBeside the usual [template features of go](https://golang.org/pkg/text/template/) a bunch of bot specific commands are available in the template scope.\n\nA list of all available functions (with arguments and return types) can be generated by using the `list template functions` command.\n![Screenshot](./docs/template_functions.png)\n\n**Note:** This template functions can be used in different commands/features:\n- [Crons](#cron)\n- [Defined commands](#commands)  (via .yaml)\n- [Custom commands](#custom-command)  (defined per user)\n- [Jenkins hooks](#jenkins) (like sending custom message when a Job fails)\n\n## Retry\nWith `retry` or `repeat` your last executed command will be re-executed. -\u003e Useful when a failed Jenkins job got fixed.\n\n## Delay\nA small command which might be useful in combination with `command` command or as hook for Jenkins jobs.\n\nExample command: `delay 10m trigger job DeployWorldwide`\n\nAs reply you'll get a command to stop the queued job (like `stop timer 123456`). As everyone can send the command, the command can be used to announce a deployment and in doubt, the execution can still be stopped by everyone.\n\n## Reply / send message\n`reply` and `send message` are also small commands which are useful in combination with `command` or Jenkins hooks.\n\n**Examples:**\n- `send message to #backend The job failed :panic:`\n- `delay 10m send message to @peter_pan I should notify you to...`\n\n## Random\nSimple command if you are not able to decide between different options\n\n**Examples**\n- `random Pizza Pasta` -\u003e produce either \"Pizza\" or \"Pasta\" \n- `random Peter Paul Tom Jan` -\u003e who has to take about organizing food today?\n\n# Installation\n1. Make sure Go version 1.12+ is installed\n2. clone the project\n3. create config file called `config.yaml` (you can take a look at `config.example.yaml`)\n \n## Run without docker\nThis command will start the bot, using the `config.yaml` file by default. Use the `-config` argument to use the config file(s) from another location.\n```\ngo run cmd/bot/main.go\n```\n\n## Run via docker-compose\n**Attention**: Create a config.yaml file first\n\n```\ndocker-compose up\n```\n\n# Configuration\nThe configuration is managed via simple .yaml files which are storing the credentials for the external services and the custom commands etc.\n\nThe easiest way is to just have one `config.yaml` file with all needed options included, the `config.yaml` is loaded by default. It's also possible to split up the configuration into multiple files.\n\n**Example structure with multiple config files:**\n- `secret.yaml` containing the credentials for the external services (Slack, Jenkins) - can be managed by puppet/ansible etc.\n- `jenkins.yaml` configuration of Jenkins job and their parameters etc\n- `project-X.yaml` custom commands for a specific team\n- `project-Y.yaml`\n\nTo load the multiple config files, use `go run cmd/bot/main.go -config /path/to/config/*.yaml` which merged all configs together.\n\n## Slack\nTo run this bot, you need a \"bot token\" for your Slack application. See the [installation](#installation) section on how to create a proper app with the needed tokens.\n\n## Jenkins config\nTo be able to start or monitor Jenkins jobs, you have to setup the host and the credentials first. The user needs read access to the jobs and the right to trigger jobs for your whitelisted jobs.\n```yaml\njenkins:\n     host: https://jenkins.example.de\n     username: jenkinsuser\n     password: secret\n```\n\n### Jenkins jobs\nTo be able to start a job, the job and its parameters have to be defined in the config.\n\nA job without any parameter looks very simple:\n```yaml\njenkins:\n  jobs:\n    CleanupJob:\n```\nThen you can use `trigger job CleanupJob` or `start job CleanupJob` to start the job. It will also notify you when the job succeeded or failed (incl. error log). \n\nNext, a job with two parameters:\n```yaml\njenkins:\n  jobs:\n    RunTests:\n      parameters:\n      - name: BRANCH\n        default: master\n        type: branch\n      - name: GROUP\n        default: all\n```\nThis job can handle two parameters:\n - BRANCH: VCS branch name, \"master\" as default\n - GROUP: optional parameter, using \"all\" as default\n        \nIf you setup the VSC in the config, you don't have to pass the full branch name, but can use the fuzzy search.\n\n**Example:**\n - `start job RunTests` would start \"all\" groups on master branch\n - `start job JIRA-1224 unit` would try to find a matching branch for the ticket number. (Error message if there is no unique search result!)\n        \nNow a more complex example with more magic: \n```yaml\njenkins:\n     jobs:\n       DeployBranch:\n         trigger: \"deploy (?P\u003cBRANCH\u003e[\\\\w\\\\-_\\\\.\\\\/]*) to (?P\u003cENVIRONMENT\u003eprod|test|dev)\"\n         parameters:\n         - name: BRANCH\n           default: master\n           type: branch\n         - name: ENVIRONMENT\n         onsuccess:\n          - reply Tadaa: Take a look on http://{{ .ENVIRONMENT }}.example.com\n```\n**Step by step:**\nThe `trigger` is a regular expression to start the job, which may contain named groups. The regexp groups will be matched to the job parameters automatically.\n\nThen you can use `deploy bugfix-1234 to test` to start the Jenkins job.\n\n**Note:** You can always start this job also via `start job DeployBranch master`. The `trigger` is just an alternative.\n\nThe `onsuccess` is a hook which will be executed when a job is started via this bot.\nIn addition, `onsuccess` and `onerror` is also available...e.g. to send custom error messages.\n\n\n## Cron\nIt's possible to define periodical commands via crons, using the [robfig/cron library](github.com/robfig/cron).\n\n**Example config**\n```yaml\ncrons:\n  - schedule: \"0 8 * * *\"\n    commands:\n      - trigger job BuildClients\n      - then deploy master to staging\n    channel: \"#backend\"\n```\n\n## VCS / Stash / Bitbucket\nTo be able to resolve branch names in Jenkins trigger, a VCS system can be configured (at the moment it's just Stash/Bitbucket).\n```yaml\nvcs:\n  type: bitbucket\n  host: https://bitbucket.example.com\n  username: readonlyuser\n  password: secret\n  project: MyProjectKey\n  repository: repo_name\n```\nIf no config is provided, there is no automated branch lookup and the \"branch\" parameters are passed 1:1 to the Jenkins job.\n\n\n## Disable commands/features\nSome features might not be needed in your environment. Most ones are not active if the credentials are not provided, like for Jira or Bitbucket.\n\nSome other ones can be disable via config:\n```yaml\ngames:\n  enabled: false\n\ncustom_commands:\n  enabled: false\n\ncustom_variables:\n  enabled: false\n```\n\n# Development\n\n## File structure\n- `bot/` contains the code classes of the bot: connection to Slack, user management, command matching...\n- `cmd/bot/` entry points aka main.go for the bot and the CLI test tool\n- `command/` real command implementing the bot.Command interface\n\n## Create a new (native) command\nIf you need a new command, which is not implementable with a \"command\" command, you have to write go code.\n- create a new file within the \"commands/\" directory or one submodule of it\n- create a new struct which fulfills the bot.Command interface. The service.SlackClient might be needed as dependency\n- GetMatcher() needs to provide the information which command text is matching our command\n- register the command in command/commands.go\n- restart the bot application\n- it's recommended to fulfill the bot.HelpProvider (your command will show up in `help)\n- it's also recommended to create an integration test for your command\n\n## CLI tool\nThere is a handy CLI application which emulates the Slack application...just chat with your local console without any Slack connection!\n![CLI tool](./docs/cli.png)\n```\nmake run-cli\n```\n\n## Auto live reload\n`make air` to use the [\"air auto reload tool\"](https://github.com/cosmtrek/air).\n\n## Testing\nThere are a bunch of tests which can be executed via:\n```\nmake test\n```\n\nTest coverage is generated to build/coverage.html\n```\nmake test-coverage\n```\n","funding_links":[],"categories":["Bot建设","Bot Building","Chatbots","Go","Uncategorized"],"sub_categories":["Contents","Free e-books"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnogames%2Fslack-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finnogames%2Fslack-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnogames%2Fslack-bot/lists"}