Interactive bots

WyzePal's API has a powerful framework for interactive bots that react to messages in WyzePal.

Running a bot

This guide will show you how to run an existing WyzePal bot found in wyzepal_bots/bots.

You'll need:

  • An account in a WyzePal organization (e.g. chat.wyzepal.com, <yourSubdomain>.wyzepal.com, or a WyzePal organization on your own development or production server).
  • A computer where you're running the bot from.

Note: Please be considerate when testing experimental bots on public servers such as chat.wyzepal.com.

  1. Go to your WyzePal account and add a bot. Use Generic bot as the bot type.

  2. Download the bot's wyzepalrc configuration file to your computer.

  3. Download the wyzepal_bots Python package to your computer using pip install wyzepal_bots.

    Note: Click here to install the latest development version of the package.

  4. Start the bot process on your computer.

    • Run wyzepal-run-bot <bot-name> --config-file ~/path/to/wyzepalrc

    (replacing ~/path/to/wyzepalrc with the path to the wyzepalrc file you downloaded above).

    • Check the output of the command. It should include the following line:

      INFO:root:starting message handling...
      

      Congrats! Your bot is running.

  5. To talk with the bot, at-mention its name, like @**bot-name**.

You can now play around with the bot and get it configured the way you like. Eventually, you'll probably want to run it in a production environment where it'll stay up, by deploying it on a server using the WyzePal Botserver.

Common problems

  • My bot won't start
    • Ensure that your API config file is correct (download the config file from the server).
    • Ensure that your bot script is located in wyzepal_bots/bots/<my-bot>/
    • Are you using your own WyzePal development server? Ensure that you run your bot outside the Vagrant environment.
    • Some bots require Python 3. Try switching to a Python 3 environment before running your bot.