BearyChat

class flask_bearychat.bearychat.BearyChat(app=None)[source]
command(command, **kwargs)[source]

A decorator for registering a command handler. Example:

@bearychat.command('hi')
def hi(**kwargs):
    user_name = kwargs.get('user_name')
    return bearychat.response('Hi, %s' % user_name)
Parameters:
  • command – the command to register.
  • kwargs – extra args pass to the function.
dispatch()[source]

A flask view function which dispath the http request to matching registered command handler. Before using Flask-BearyChat, you should add url rule with this method as view_func.

response(text, attachments=None)[source]

Generate a response for BearyChat’s outgoing robot.

Parameters:
  • text – A text which going to response to robot.
  • attachments – options attachements.