Skip to main content

Framework to program bots !!

Project description


INTRO

| BOTJE is a python3 framework which you can use to program bots.
| BOTJE makes it possible to program your own module enabling your own commands.
| BOTJE contains serveral modules that can be used to program.
| BOTJE has a MIT no-clause :ref:`license <license>`.

INSTALL

you might need to do one of the following if the bot doesn't work:

::

bart@okdan:~/botje$ export PYTHONPATH="."
bart@okdan:~/botje$ export PYTHONIOENCODING="utf-8"


clone the source:

::

bart@okdan:~$ hg clone https://bitbucket.org/bthate/botje


another option is to download with pip3 and install globally:

::

bart@okdan:~$ pip3 install botje --upgrade


IRC

use -n <nick>, -s <server>, -c <channel> options to make the bot join the network:

::

bart@okdan:~$ bot-irc -n botje -s irc.freenode.net -c \#botje

USERS

One needs to add a users origin to be able to give the bot commands. One can add a user with the meet command:

::

bart@okdan:~$ bot meet user@server
user user@server created

To give the user a permission you can use the perm command:

::

bart@okdan:~$ bot perm user@server ps
ok user@server

The default shell user is root@shell and gives access to all the commands that are available.

PROGRAMMING

| User programmed modules are read from the ~/.mods directory, you can put your .py files over there.

example:

::

def hi(event):
event.reply("hi %s" % event.origin)

MODULES

The following modules are available:

bot.clk, timer/repeater/timed daemon (clock).
bot.cmd, basic commands (commands).
bot.dbz, access saved json files (databases).
bot.dcc, direct client to client bot (DCC).
bot.eml, botlib basic commands (email).
bot.evt, event class (event).
bot.hdl, event handler based on queue.Queue (handler).
bot.irc, irc bot (IRC).
bot.lcs, license command (license).
bot.ldr, load modules (loader).
bot.log, log module to set standard format of logging (log).
bot.obj, object class with save/load of json files (object).
bot.raw, raw output using print (raw).
bot.rss, rss module (needs feedparser).
bot.shl, shell related functionality (shell).
bot.slt, select based loop (select).
bot.thr, threading module (launcher).
bot.tmd, timed helper functions (timed).
bot.trc, stack trace helper functions (trace).
bot.udp, relay txt through a udp port listener (UDP).
bot.url, functions that fetch data from url (url).
bot.xmpp, xmpp bot (requires sleekxmpp).

COMMANDS

Over 60 commands are now available in BOTJE:

announce, announce text on all channels in fleet.
begin, begin stopwatch.
cfg, edit config files.
cmds, show list of commands.
deleted, show deleted records.
delperm, delete permissions of an user.
edit, edit and save objects.
end, stop stopwatch.
exit, stop the bot.
find, present a list of objects based on prompt input.
first, show the first record matching the given criteria.
fix, fix a object by loading and saving it.
last, show last objectect matching the criteria.
load, force a plugin reload.
log, log some text.
loud, disable silent mode of a bot.
ls, show subdirs in working directory.
man, show descriptions of the available commands.
meet, create an user record.
mods, show available modules.
nick, change bot nick on IRC.
perm, add/change permissions of an user.
permissions, show permissions granted to a user.
perms, show permission of user.
pid, show pid of the bot.
ps, show running threads.
reboot, allowing statefull reboot (keeping connections alive).
reload, reload a plugin.
restore, set deleted=False in selected records.
rm, set deleted flag on objects.
rss, add a rss url.
shop, add a shopitem to the shopping list.
show, show dumps of basic objects.
silent, put a bot into silent mode.
start, start a plugin.
stop, stop a plugin.
synchronize, synchronize rss feeds (fetch but don't show).
test, echo origin.
timer, timer command to schedule a text to be printed on a given time. stopwatch to measure elapsed time.
tinder, loop an command nr of times.
today, show last week's logged objects.
todo, log a todo item.
tomorrow, show todo items for tomorrow.
u, show user selected by userhost.
uptime, show uptime.
version, show version.
w, show user data.
watch, add a file to watch (monitor and relay to channel).
week, show last week's logged objects.
whoami, show origin.
yesterday, show last week's logged objects.
mbox, convert emails to botlib objects.

CONTACT

You can email me or contact me on IRC/freenode/#dunkbots.

| Bart Thate
| botfather on #dunkbots irc.freenode.net
| bthate@dds.nl, thatebart@gmail.com
| hg clone https://bitbucket.org/bthate/botje


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
botje-52.tar.gz (45.3 kB) Copy SHA256 hash SHA256 Source None Dec 27, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page