Skip to content

A Facebook chatbot designed to remember your loved ones to stay hydrated.

License

Notifications You must be signed in to change notification settings

alexanderroidl/hydrabot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

HydraBot

A facebook chatbot built around fbchat library, designed to remember your loved ones to stay hydrated.

Contents

1. Requirements

2. Installation

2.1. Virtual environment

To understand what virtual environments are and why you'll want them, see this document.

2.1.1 Creation

$ pip install virtualenv # Install virtualenv first
$ cd HYDRABOT_DIRECTORY
$ virtualenv venv # Creates a new virtual environment inside "venv" directory

2.1.2 Activation

Windows:

$ source venv/Scripts/activate

Linux/Mac OS:

$ source venv/bin/activate

2.2 Python packages

$ pip install -r requirements.txt

On windows you will need an additional module:

$ pip install windows-curses

3. Usage

Remember to activate your virtual environment if you haven't already.

$ python HYDRABOT_DIRECTORY

4. How it works

  • The bot is active during a given timespan and sends groups of messages
    • Will choose plain text message, emoji message and/or image based on possible texts, emojis, etc. (Minimum one message type, maximum all three types)
    • Randomly chooses amount of message groups to send during given timespan
  • Can announce itself by waving first
  • Is able to change thread emoji temporarily
  • Imitates human behaviour by "typing" before sending and delaying texts
  • Modes available:
    • demo - Doesn't connect to FB (preview mode)
    • test - Ignores times
    • Modes can be combined or turned off entirely.

5. Configuration

The bot can be configured by modifying the file hydrabot_py/config.py. As it's very extensive, it will mostly not be explained here, but rather by comments inside the file.

5.1 Enable random image messages

This is optional. By default no image messages will be sent.

In order for random images to work you have to provide required values for Giphy and/or Google Image Search.

Get started:

  • Set image_chance_per_message config variable to a value above 0.
  • Optional: Adjust image_gis_giphy_chance config variable. (Explained by comment inside config file)

For Giphy:

  1. Obtain Giphy API key
  2. Set giphy_api_key configuration variable to API key.

For Google Image Search:

  1. Create a Google Custom Search
  2. Enable Image Search for it
  3. Set gis_api_key to your API key and gis_project_cx to your project CX.

6. Credits

About

A Facebook chatbot designed to remember your loved ones to stay hydrated.

Resources

License

Stars

Watchers

Forks

Languages