phial

A lightweight framework for building slack bots

Phial is a slack bot framework, modelled loosely on flask.

Usage

Python:

from phial import Phial, command, Response

bot = Phial('---slack token here---')

@bot.command('greet <name>')
def greet(name):
    '''A command with an argument which replies to a message'''
    return "Hello {0}".format(name)

bot.run()

Slack:

By default the bot requires a prefix of ! before its commands. This can be changed in the config.

youruser:
> !greet jim
bot:
> Hello Jim

Features:

  • Decorator based command definition
  • Send messages to slack
  • Reply to messages in a thread
  • Reply to messages with a reaction
  • Upload Files

Examples of commands utilising these features can be found in the examples folder

Install

$ pip install phial-slack

GitHub

https://github.com/sedders123/phial