SLAPI Brain

The Brain is a Redis Server in a docker container managed by the bot.

See: The Brain Class for more specific info

Docker Image Utilized: Dockerhub Dockerfile/Version

Docker Tag: redis:3-alpine

Usage

Note: The brain can only be used at the library level by the bot itself.

Plugin Access

Plugins may access the Brain via API, we have gone the simplest route possible for brain access.

Save Key
  • Endpoint: $bot_url/v1/save
  • Type: Post
  • Params (All Required):
    • plugin: $plugin_name (Utilized as Hash Name)
    • key: $key_name
    • value: $value to save

Examples

curl -X POST -d "plugin=hello&key=world&value='what a world'" http://localhost:4567/v1/save
Query Key
  • Endpoint: $bot_url/v1/query_key
  • Type: Post
  • Params (All Required):
    • plugin: $plugin_name (Utilized as Hash Name)
    • key: $key_name
  • Returns Key Value

Examples

curl -X POST -d "plugin=hello&key=world" http://localhost:9292/v1/query_key
Query Hash
  • Endpoint: $bot_url/v1/query_hash
  • Type: Post
  • Params (All Required):
    • plugin: $plugin_name (Utilized as Hash Name)
  • Returns Hash Keys

Examples

curl -X POST -d "plugin=hello" http://localhost:9292/v1/query_hash
Delete Key
  • Endpoint: $bot_url/v1/delete
  • Type: Post
  • Params (All Required):
    • plugin: $plugin_name (Utilized as Hash Name)
    • key: $key_name

Examples

curl -X POST -d "plugin=hello&key=world" http://localhost:4567/v1/delete