Mediabot

IRC bot since 2007. Modernized, modular, still alive.

WHAT IS MEDIABOT?

Undernet (ircu) Libera Epiknet Perl since 2007

mediabot_v3 has been tested on Undernet ircu server, Libera and Epiknet (but it may support other networks). The bot joins a console channel where it will notice its actions.

  • Read the README file to know how to deploy it.
  • Read the Wiki Documentation to know how to register it at first use.
  • Refer to the bot log file to know what is going on.

Eggdrop

IRC bots, TCL scripts and more.

This section contains notes about Eggdrop and Windrop, including Tcl scripting, portable builds, HTTPS/TLS compatibility, performance tuning, and general bot maintenance.

Official Project Official Eggdrop Page ↗

Eggdrop is the oldest Internet Relay Chat (IRC) bot still in active development. Originally created by Robey Pointer in December 1993 for use on a channel called #gayteen, it has spawned an almost cult-like following of users. It is a feature rich program designed to be easily used and expanded upon (using Tcl scripting) by both novice and advanced IRC users on a variety of hardware and software platforms.

Latest Release Tcl/Tk 9.0.3 (Nov 13, 2025) ↗

Tcl/Tk 9.0 is the latest major release of both Tcl and Tk. It features many new capabilities, and presents some incompatibilities with Tcl/Tk 8.

chatGPT v1.3.17
chatGPT (eggdrop 1.8.4+/tcllib 1.18+)
Dernière mise à jour 27/01/2026 · 6 KB
DansTonChat v1.14.7
Dans Ton Chat
Dernière mise à jour 15/12/2025 · 7 KB
ddg v1.0.7
Recherche DuckDuckGo (bêta)
Dernière mise à jour 09/01/2026 · 6 KB
meteo v1.3.2
Météo (wttr.in, HTTPS/SNI, emojis)
Dernière mise à jour 05/02/2026 · 6 KB
vdm v1.1.2
Vie De Merde (VDM)
Dernière mise à jour 08/02/2026 · 5 KB
youtube_search v1.2.1
Recherche YouTube (API v3)
Dernière mise à jour 21/10/2025 · 5 KB

Links

GitHub

Repo: teuk/mediabot_v3 · cache: 13/04/2026 02:06:05 · clones (14d): 354 · uniques: 122

Recent commits
SHAMessageAuthorDate
fb250f8 🪄 Lumos in the dark corners: tamed URL titles, taught Mediabot new tricks, and banished a few sneaky parsing curses teuk 2026-04-10
eadb5ec 🧙 Snape's Potion Class — banish PASSWORD() to pure Perl SHA1, exorcise last getNickInfo ghost from INVITE handler, strip 44 prototypes from install scripts, reclassify noisy log(0) to log(1) teuk 2026-04-09
0a9cf8e 🧙 Nearly Headless Nick — fix userOnJoin SQL crash, restore holdcmd with ALTER TABLE, reconcile mediabot.sql schema against production DB teuk 2026-04-09
a701372 Mischief managed: fixed command status handling and tightened Mediabot’s spellbook teuk 2026-04-08
7d9452d 🧙 Moody's Eye — hunt down 8 sth->finish leaks, collapse mbQuoteStats into one query, add Partyline brute-force lockout, purge last curl calls, and retire the getNickInfo ghost teuk 2026-04-08
be15254 🧙 Dumbledore's Audit — fix Channel setters, sth->finish, bare filehandle, SELECT *, remove (@) prototypes, add hostmask cache TTL teuk 2026-04-08
98db045 ⚡ Stupefy fuzzy matches: unified hostmask magic and taught Mediabot stricter SQL spells teuk 2026-04-07
4021fb4 🪄 Mischief managed: banished stray SELECT * queries and taught Mediabot cleaner SQL spells teuk 2026-04-07
afe3ef7 🪄 Finite Incantatem on the Old Magic! Banished 27 ancient implicit JOIN horcruxes lurking across 9 modules — every FROM A,B,C WHERE A.id=B.id dark spell rewritten as proper JOIN ... ON incantations i teuk 2026-04-07
4c2f629 🧹 Scourgify Maxima! Banished 11 phantom statement handles haunting the dungeons of Helpers.pm, UserCommands.pm, ChannelCommands.pm and Hailo.pm — every prepare() now earns its finish(). Vanished a ro teuk 2026-04-07

README

Mediabot - https://teuk.org

Mediabotv3 is a perl Net::Async::IRC bot now tho I started it with Net::IRC which is now deprecated It is still a beta version after all these years but a release is coming up WHAT IS MEDIABOT? Mediabot is a Net::Async::IRC bot tested on Undernet ircu server, Libera and Epiknet (but it may supports other networks) The bot joins a console channel where it will notice its action Go to the Wiki section and read Installation chapter to know how to deploy it. The full documentation is in the Wiki section : https://github.com/teuk/mediabot_v3/wiki

mediabot_v3

I've been coding this bot for a while, and it's time to write documentation (about time) This perl bot is using Net::Async::IRC and a MySQL/MariaDB backend. I tried to make things easier to install by running the configure script but sometimes it needs manual actions. Check the Installation chapter for hints. I hope you'll have fun using mediabot :) TeuK

Notes

Get the latest news on Mediabot here : https://teuk.org/forum

Installation

Creating a dedicated user

This is an installation example on Debian GNU/Linux 13 (trixie) Add a mediabot user :

sudo useradd -m -s /bin/bash mediabot

Now, give sudo rights to mediabot user and keep in mind that you MUST remove this file after the installation ! If you don't, you let an irc bot running with root privileges (trust me you don't want that).

echo 'mediabot ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/mediabot

Required packages installation

Install needed packages :

sudo apt install build-essential mariadb-server mariadb-client libmariadb-dev libmariadb-dev-compat git curl cpanminus chromium yt-dlp

Bot installation

Now get the bot as mediabot user and run configure script :

sudo -iu mediabot
git clone https://github.com/teuk/mediabot_v3
cd mediabot_v3

The following script is supposed to do all the work for DB creation and Perl modules installation (but you may have to do manual actions sometimes) :

./configure

Running the test framework

Before running the bot, you can verify that the core logic is working correctly by running the test suite (no IRC connection required) :

perl t/test_commands.pl

All tests should pass :

[ 01_context.t ]
[ 02_dispatch.t ]
[ 03_auth.t ]
[ 04_mockbot.t ]
============================================================
PASSED : 115/115  (13s)
============================================================

For detailed output of each individual test :

perl t/test_commands.pl --verbose

Available options :

--verbose, -v          Show each test result [OK]/[FAIL]
--filter,  -f <pat>    Run only files matching <pat>  (e.g. --filter 03)
--nick,    -n <nick>   Default nick for test messages  (default: testuser)
--host        <host>   Default hostname                (default: test.host)
--channel, -c <chan>   Default channel                 (default: #test)
--botnick, -b <n>      Bot nick                        (default: mediabot)
--cmdchar     <char>   Command character               (default: !)

Running the live IRC test framework

The live test framework connects a real bot instance and a spy client to an IRC server, creates a dedicated mediabot_test database, runs a series of end-to-end tests, then tears everything down automatically.

Requirements :

  • An accessible IRC server (local ircu on localhost:6667 is recommended for speed and reliability)
  • sudo mysql access (socket authentication, no password required)
  • All Perl dependencies already installed by ./configure

Basic usage against a local ircu server :

perl t/test_live.pl --server localhost --port 6667 --channel '#mbtest'

All tests should pass :

[ 01_connect.t ]
[ 02_commands.t ]
[ 03_auth_live.t ]
============================================================
PASSED : 13/13  (22s)
============================================================

For detailed output of each individual test :

perl t/test_live.pl --verbose --server localhost --port 6667 --channel '#mbtest'

Keep the test database after the run for inspection :

perl t/test_live.pl --keep-db --server localhost --port 6667 --channel '#mbtest'

Available options :

--server, -s  <host>   IRC server              (default: irc.libera.chat)
--port        <port>   IRC port                (default: 6667)
--channel, -c <chan>   Test channel            (default: ##mbtest)
--botnick, -b <nick>   Bot nick                (default: mbtest_XXXX)
--spynick     <nick>   Spy client nick         (default: mbspy_XXXX)
--cmdchar     <char>   Command character       (default: !)
--timeout, -t <sec>    Per-reply timeout       (default: 30)
--keep-db              Keep mediabot_test DB after tests
--verbose, -v          Show each test result [OK]/[FAIL]
--filter, -f  <pat>    Run only files matching <pat>  (e.g. --filter 02)

Running the bot

If everything's ok then test in foreground using your config file e.g :

./mediabot.pl --conf=mediabot.conf
[06/08/2022 06:31:37] Reading configuration file mediabot.conf
[06/08/2022 06:31:37] mediabot.conf loaded.
[06/08/2022 06:31:37] Getting current version from VERSION file
[06/08/2022 06:31:37] -> Mediabot devel version 3.0 (20220801_111934)
[06/08/2022 06:31:37] Checking latest version from github (https://raw.githubusercontent.com/teuk/mediabot_v3/master/VERSION)
[06/08/2022 06:31:37] -> Mediabot github devel version 3.0 (20220801_111934)
[06/08/2022 06:31:37] Mediabot is up to date
[06/08/2022 06:31:37] Mediabot v3.0dev-20220801_111934 started in foreground with debug level 0
[06/08/2022 06:31:37] Logged out all users
[06/08/2022 06:31:37] Picked irc.mediabot.rules from Network Mediabot_Rules
[06/08/2022 06:31:37] Initialize Hailo
[06/08/2022 06:31:37] Connection nick : mediabot
[06/08/2022 06:31:37] Trying to connect to irc.mediabot.rules:6667 (pass : none defined)
[06/08/2022 06:31:37] *** Looking up your hostname
[06/08/2022 06:31:37] *** Checking Ident
[06/08/2022 06:31:37] *** Found your hostname
[06/08/2022 06:31:37] *** Got ident response
[06/08/2022 06:31:37] on_login() Connected to irc server irc.mediabot.rules
[06/08/2022 06:31:37] Checking timers to set at startup
[06/08/2022 06:31:37] No timer to set at startup
[06/08/2022 06:31:37] on_login() Setting user mode +i
[06/08/2022 06:31:37] Trying to join #mediabot
[06/08/2022 06:31:37] No channel to auto join
[06/08/2022 06:31:37] -irc.mediabot.rules- Highest connection count: 2 (2 clients)
[06/08/2022 06:31:37] -irc.mediabot.rules- on 1 ca 1(4) ft 10(10) tr

And you should see the bot join on #mediabot console channel :

[06:30:25] * Now talking in #mediabot
[06:31:39] * Joins: mediabot (mediabot@mediabot.mediabot.rules)

To run the bot in daemon mode :

./mediabot.pl --conf=mediabot.conf --daemon

Always have a look at what is going on :

tail -40f mediabot.log

DON'T FORGET TO REMOVE SUDO RIGHTS, THIS IS IMPORTANT ! :

sudo rm -fv /etc/sudoers.d/mediabot

Once you did all that, register your bot and see the commands available in Wiki section : https://github.com/teuk/mediabot_v3/wiki