Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cixtor/slackbot
Slack event monitor using their RTM (Real Time Messaging) API, it can be extended to react to user and bots, implement interactive messages and reply to custom commands
https://github.com/cixtor/slackbot
Last synced: 10 days ago
JSON representation
Slack event monitor using their RTM (Real Time Messaging) API, it can be extended to react to user and bots, implement interactive messages and reply to custom commands
- Host: GitHub
- URL: https://github.com/cixtor/slackbot
- Owner: cixtor
- License: mit
- Created: 2017-06-20T19:44:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-28T08:18:35.000Z (almost 3 years ago)
- Last Synced: 2024-04-14T20:11:47.857Z (8 months ago)
- Language: Go
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
### Slackbot
The Slackbot is a service written in Go and leverages the power of the [slackapi](https://github.com/cixtor/slackapi) library to connect to Slack's RTM _(Real Time Messaging)_ websocket and react to events triggered by users or bots in the allowed channels.
You can find a list of implemented commands below and you can use them as a template to create more commands to match your specific needs. The project also includes a _Makefile_ with an instruction to facilitate the deployment of your code to production using the cross-compilation feature available in the Go compiler, rsync and a cronjob in the remote machine.
### Deployment
The _Makefile_ in the repository includes an instruction to deploy your new code to production, it will compile the source files in the host cross-compiling to a Linux-adm64 machine, then will upload the _"init.sh"_ to the remote server as a script into the `/etc/init.d/` directory, then will upload the new binary + README + auto-deploy script to a pre-defined directory. The target directory of the upload will be monitored by another script _"autodeploy.sh"_ which runs with a cronjob every minute and detects if the new binary, named _"slackbot.new"_ exists, in which case will assume that a new deployment was executed, then will stop the running service using the script in `/etc/init.d/`, replace the old binary with the new one, and start the service again using the new code.
Please make the appropriate changes to match your needs.
### Command - Help
Send `help` as a direct message to **@slackbot** and it will reply with the content of this Markdown file with the corresponding modifications to make the titles, links, bold text appear with the correct style in Slack.
### Command - Uptime
Send `uptime` as a direct message to **@slackbot** and it will reply with the amount of time since the last update, this is, the time since the service was restarted. The time is reset every time the cronjob in the remote machine detects a deployment.