Skip to content

bscan/python-slackbot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-slackbot

A Slack bot written in python that allows for two way communication.

Originally forked from https://github.com/slackhq/python-rtmbot, python-slackbot is the simplest way to build a Bot user for Slack. Unlike python-rtmbot, this repo has full support for messages with UTF-8 characters and automatic reconnects.

Example Arnold Bot

from slackbot import SlackBot
import random

def arnold(client, event):
    # Ignore what the user said, simply generate random arnold quote
    quotes = [u"Milk is for babies. When you grow up you have to drink beer.",
              u"Start wide, expand further, and never look back.",
              u"If it bleeds, we can kill it."]
    return random.choice(quotes)


token = 'SLACK TOKEN HERE'
my_bot = SlackBot(token, arnold)
my_bot.start()

Dependencies

About

Bot Framework for Slack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%