Skip to content

i-2/taggo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Taggo

A Facebook bot full configurable over yaml.

Deploy

Cloning and Running


git clone https://github.com/vttach/taggo.git

# change to cloned directory
cd taggo/

python setup.py install

taggo  # Run taggo

Environmental Variables:

export YAML_URL=<url where the yaml has to be loaded from>
export ACCESS_TOKEN=<facebook page access token>
export VF_TOKEN=<verfication token for bot>

Configuration

default: 
   ....

requests:
   - ...

The yaml defines rule called requests which defines the set of text patterns to be matched from. And the default rule which will be executed when no match is found on requests.

A typical request command looks like below

requests:
  - name: sayhello
    pattern: hello
    response:
       type: text
       text: hello
  
  - name: order tracking
    pattern: track\s+order\s+(?P<track>.*)?
    webhook: http://api.helloworld.com
    method: post
    type: json
    params: 
       - track
    response:
       type: template
       template_type: generic
       elements:
          - title: "title"
            image_url: "https://cldup.com/xxx.jpg"
            subtitle: "We have a subtitle"
            buttons: 
               - type: "web_url"
                 url: "https://mycompany.in"
                 title: "mycompany"
  • name: Name of the action.
  • pattern: A regex pattern to match the particular action.
  • webhook: A webhook which can be initiated when the message is recived.
  • method: Method assosiated with the webhook
  • params: Parameters which will sent along the request to webhook url. Taken from the named groups in pattern.
  • response: Type of response to be made by bot(defaults to text). But also supports templates. The parameter template_type can be either generic or list template.

License

MIT

About

Yet an other bot

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •