the python3 bot namespace.
Project description
NAME
BOTLIB - python3 bot library
SYNOPSIS
bot <cmd> [key=value] [key==value]
DESCRIPTION
BOTLIB is a solid, non hackable bot, that runs under systemd as a 24/7 background service and starts the bot after reboot, intended to be programmable in a static, only code, no popen, no imports and no reading modules from a directory.
BOTLIB is programmable, to program the bot you have to have the code available as employing your own code requires that you install your own bot as the system bot. This is to not have a directory to read modules from to add commands to the bot but include the own programmed modules directly into the python code, so only trusted code (your own written code) is included and runnable. Reading random code from a directory is what gets avoided. As experience tells os.popen and __import__, importlib are avoided.
BOTLIB stores it’s data on disk where objects are time versioned and the last version saved on disk is served to the user layer. Files are JSON dumps that are read-only so thus should provide (disk) persistence more chance. Paths carry the type in the path name what makes reconstruction from filename easier then reading type from the object.
Only include your own written code should be the path to “secure”.
INSTALL
pip3 install botlib
CONFIGURATION
configuration is done by calling the config command of the bot.
irc
sasl
users
SYSTEMD
$ sudo cp /usr/local/share/botd/botd.service /etc/systemd/system$ sudo systemctl enable botd --nowuse botctl instead of the use bot program
$ sudo botctl cfg server=<server> channel=<channel> nick=<nick>$ sudo bptctl pwd <nickservnick> <nickservpass>$ sudo botctl cfg password=<outputfrompwd>$ sudo botctl cfg users=True$ sudo botctl met <userhost>
RUNNING
run the bot with the bot command, it will start a shell with the irc bot. use the -c option if you just want the console.
bot [-c]
console
irc
COMMANDS
the bot has the following commands.
here is a short description of the commands.
PROGRAMMING
git clone https://github.com/bthate/botlib
joe bot/hello.py
from bot.hdl import Commands def hlo(event): event.reply("hello!") Commands.add(hlo)
COPYRIGHT
BOTLIB is placed in the Public Domain. No Copyright, No License.
AUTHOR
Bart Thate
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.