A python framework for creating chatbots on the StackExchange network.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Source Implement #6; add a reboot method (untested) Aug 20, 2018
build/lib/BotpySE 0.5.0; Huge overhaul Mar 17, 2018
docs
.gitignore
BotpySE README updates Sep 23, 2017
LICENSE Add WTFPL License Mar 17, 2018
MANIFEST 0.5.0; Huge overhaul Mar 17, 2018
README.md aaaand the readme Aug 20, 2018
__init__.py go to version 0.1.14 Sep 23, 2017
requirements.txt v0.6.0; add Redunda support (not finished) Mar 20, 2018
setup.py Missed setup.py Aug 20, 2018

README.md

Botpy

A python framework for creating bots on the StackExchange network. Builds upon ChatExchange to create a nice framework to help you make bots without the nitty-gritty you would otherwise have.

Features:

  • ChatUser management, along with privilege levels. Set up privilege levels using a single line of code. Botpy also provides different privilege chat commands to get your privilege system up and running in seconds!
  • Command management, which you can easily extend with your own commands. Provides a simple template to make commands. Also provides a huge number of default commands you can configure.
  • Redunda support, to help you run multiple instances at the same time and also have backups of all your bot data.
  • A fully functional background task manager using threads, which allows you to add your own tasks. Automatically stops and starts tasks based on the status of the instance.

Installation

Botpy does not support any versions of Python before Python3. It has been thoroughly tested on Python 3.6 (and should work for 3.x).To install Botpy, run:

pip3.6 install BotpySE --user

or

sudo -H pip3.6 install BotpySE

Quick start

You should be able to import BotpySE in your program.

import BotpySE as bp

Once imported, to initialise a really simple bot with all the default commands, do the following:

bot = bp.Bot("<enter bot name here>", bp.all_commands, [1], [], "stackoverflow.com", "<enter email for SE>", "<enter password for SE>")

The first argument is the bot name. Pings to the name (@<enter bot name here>) will run the appropriate commands. The seconds argument is

Changelog

  • v0.6.6: Implement a reboot method (#6).
  • v0.6.5: Use logging instead of prints.
  • v0.6.4: Let Botpy users override commands and choose privileges.
  • v0.6.3: Allow addition of files to be synced with Redunda.
  • v0.6.2: Small changes to location support.
  • v0.6.1: Add location support.
  • v0.6.0: Add Redunda support.
  • v0.5.1: Allow change of storage prefix.
  • v0.5.0: Huge overhaul; a lot has changed. Most classes now inherited from ChatExchange.
  • v0.4.3: Misc Changes
  • v0.3.10: A bug fix in the reboot check background task.
  • v0.3.9: Missed uploading a file.
  • v0.3.8: Fix a bug in v0.3.7.
  • v0.3.7: Add a command to reboot the bot.
  • v0.3.6: Add a parameter in the Bot class to indicate whether the bot is alive or not.
  • v0.3.5: Add a command to list privileged users.
  • v0.3.4: (Possible) Critical bug fix in command manager.
  • v0.3.3: Fix a couple of exceptions.
  • v0.3.2: Fix a bug in command initialization.
  • v0.3.1: Typo bug fix.
  • v0.3.0: Completed the privilege system by adding more commands.
  • v0.2.5: Finally fixed the bug fix for the bot name problem.
  • v0.2.4: Another possible bug fix for not allowing names with more than 4 chars.
  • v0.2.3: Possible bug fix for a bug which does not allow bot names with more than 4 letters.