Giter Site home page Giter Site logo

slackbot's Introduction

Python Slackbot

This is old code that worked circa 2016 but works no longer. I keep it here for archival purposes & to show Python code I wrote. It's the most popular repo I've created. My most recent Python repo is useful-python-scripts.

Original text below.

This standup bot is meant to be used with teams. It can be used as a 'virtual standup' bot, either to supplement or replace regular standups.

The bot goes through the users listed sequentially. If a user takes longer than the MAXIMUM_WAIT_TIME, it skips them. All the user updates are collated and printed to the designated room as the standup update. The time between the time you start the bot and the update to the room, then, depends roughly on how long people take to respond. Generally, for 3-4 few users, it will take 10-15 mins before the update hits the room.

Before a bot can speak to any user, the user must initiate a conversation with the bot; this only has to be done 1 time. The user can click on your bot and say anything (such as "hi") to satisfy this requirement.

Explanation

You'll need to customize the constants to work with your team and Slack setup. At a minimum, you'll need to add your Slack token allowing your bot to post to your company's slack rooms.

For user ID's and DM channel ID's, you can use Slack's API tester. Search for the corresponding method, take the resulting URL and open it in your browser, and search for the terms you need (username, room name, etc.) For room names, you'll need either channels.list or groups.list, depending on whether it's a public or private room, respectively.

Add those ID's to the slack.yaml file using the format shown there, and the bot will be able to pull them from there going forward.

I usually run my bot script as a cronjob.

Purpose

This is meant to be used as a template for other people to adapt and use to build their own bots.

Installation

You'll need Python as this is a Python script.

Install the Slack client using:

pip install slackclient

Install yaml using:

pip install pyyaml

License

Released under the MIT License.

slackbot's People

Contributors

julianeon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.