Skip to main content

24/7 channel daaemon.

Project description

Welcome to MADBOT, the 24/7 channel daemon ! see

MADBOT can serve as a 24/7 background daaemon in an IRC channel, it can work as a UDP to IRC relay, has user management to limit access to prefered users and can run as a service to let it restart after reboots. MADBOT is has no copyright, no license and is placed in the Public Domain. This makes MADBOT truely free (pastable) code you can use how you see fit,


you can download with pip3 and install globally:

$ sudo pip3 install madbot

You can download the tarball from

if you want to develop on MADBOT the source at

$ git clone


MADBOT has it’s own CLI, you can run it by giving the madbot command on the prompt, it will return with no response:

$ madbot

you can use madbot <cmd> to run a command directly:

$ madbot cmds

configuration is done with the cfg command:

$ madbot cfg
channel=#botlib nick=madbot port=6667 realname=madbot server=localhost username=madbot

you can use setters to edit fields in a configuration:

$ madbot cfg channel=\#dunkbots nick=madbot
channel=#dunkbots nick=botje port=6667 realname=botlib

to start a irc server with the cmd and opr modules loaded and a console running:

$ madbot mods=irc,csl,cmd,opr
> ps
0 0s       Console.input
1 0s       IRC.handler
2 0s       IRC.input
3 0s       IRC.output
4 0s       Kernel.handler

to run a pure UDP to IRC relay, run the bot with irc,udp modules loaded

$ madbot mods=irc,udp

use the udp command to send text via the bot to the channel on the irc server:

$ tail -f /var/log/syslog | madbot udp

to send a udp packet to the bot:

import socket

def toudp(host=localhost, port=5500, txt=""):
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    sock.sendto(bytes(txt.strip(), "utf-8"), host, port)


you can use the mods= setter to set the modules to load:

$ madbot mods=csl,cmd,opr
> cmd

MADBOT has the following modules:

cmd                 - commands
irc                 - internet relay chat
opr                 - opers
mbx                 - email
rss                 - rich site syndicate
udp                 - udp to channel
usr                 - users


if you want to run the bot 24/7 you can install MADBOT as a service for the systemd daemon. You can do this by copying the following into the /etc/systemd/system/madbot.service file:

Description=MADBOT - 24/7 channel daemon

ExecStart=/usr/local/bin/madbot mods=irc,rss,fnd,cmd -w


create homedir for the bot:

$ mkdir /home/madbot
$ mkdir /home/madbot/.madbot
$ mkdir /home/madbot/.madbot/mods

add the madbot user to the system:

$ groupadd madbot
$ chown -R madbot:madbot /home/madbot
$ useradd madbot -d /home/madbot
$ passwd madbot

configure the bot to connect to irc:

$ sudo -u madbot madbot cfg server= channel=#madbot nick=madbot

copy modules over to the bot’s work directory:

$ cp -Ra mods/*.py /home/madbot/.madbot/mods

make sure permissions are set properly:

$ chown -R madbot:madbot /home/madbot
$ chown -R madbot:madbot /home/madbot/.madbot
$ chmod -R 700 /home/madbot/.madbot/mods/
$ chmod -R 400 /home/madbot/.madbot/mods/*.py

add the madbot service with:

$ sudo systemctl enable madbot
$ sudo systemctl daemon-reload

then restart the madbot service.

$ sudo service madbot stop
$ sudo service madbot start

if you don’t want madbot to startup at boot, remove the service file:

$ sudo rm /etc/systemd/system/madbot.service


contact me on IRC/freenode/#dunkbots or email me at

botfather on #dunkbots

Project details

Download files

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

Files for madbot, version 12
Filename, size File type Python version Upload date Hashes
Filename, size madbot-12.tar.gz (38.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page