Git Product home page Git Product logo

slackbot's Introduction

Slackbot

The Slackbot is a service written in Go and leverages the power of the 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.

slackbot's People

Contributors

cixtor avatar

Stargazers

Cheng Ren avatar

Watchers

James Cloos avatar  avatar

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.