A database-backed, operations-oriented IRC bot for long-running communities.
Mediabot 3.3 helps IRC communities run, remember, and understand their channels. It combines channel administration, persistent community history, analytics, modern URL and media integrations, observability, and upgrade tooling in one tested application.
Instead of assembling a large collection of unrelated scripts, operators get a coherent stack with one configuration model, one MariaDB-backed data model, migrations, security checks, startup integrity validation, systemd deployment guidance, and a documented release process.
Download Mediabot 3.3 · Install in production · Explore commands · Ask a question
| What you need | What Mediabot provides |
|---|---|
| Community memory | seen, onthisday, quotes, factoids, karma, notes, reminders, milestones, and long-term channel history |
| Operational safety | guided configuration, database migrations, schema/type/index drift checks, security audit, and startup integrity checks |
| Modern IRC features | rich URL previews, media helpers, AI integrations, radio tooling, antiflood protection, and community analytics |
| Observability | Prometheus metrics, Grafana resources, structured logs, and systemd-oriented operations |
| Extensibility | Perl modules, plugins, controlled script bridges, and public contrib/ and plugins/ trees |
Mediabot is a strong fit for communities that want a bot to become part of their long-term infrastructure rather than remain a small disposable script. If you only need a tiny classic IRC bot with minimal dependencies, a lighter platform may be the better choice.
A typical channel can use commands such as:
<prefix>seen Alice
<prefix>mood
<prefix>onthisday
<prefix>topquote
<prefix>milestone
?coffee
<prefix>tell Bob remember the meeting
It can also enrich supported links, expose Prometheus metrics, integrate with radio workflows, and provide a dedicated TCP/DCC administration interface through Partyline.
The configured prefix is instance-specific and may be !, m, ., or another value chosen by the operator.
| Goal | Recommended path |
|---|---|
| Install the stable release | Download Mediabot 3.3, verify the checksums, then follow the Installation guide |
| Understand the feature set | Browse Public commands, Private/admin commands, and Partyline |
| Upgrade an existing instance | Read the Release and upgrade notes before applying migrations |
| Operate and monitor it | See Configuration, Testing, and Monitoring |
| Report or discuss something | Use Issues for reproducible work and Discussions for questions and ideas |
The wiki is the operational reference. This README keeps the essential installation and validation path available in the repository.
Mediabot uses odd minor versions for stable releases and even minor versions for development lines:
3.3 current stable release
3.4dev next development line
Release resources:
- Mediabot 3.3 GitHub release
- Changelog and 3.3 release notes
- Release and upgrade notes
- Release artifact workflow
Contributions of all sizes are welcome: code, tests, documentation, plugins, translations, installation feedback, and validation on additional IRC networks.
Report a bug · Request a feature · Ask a question · Open the wiki
Live IRC support:
Network: EpiKnet
Server: irc.epiknet.org
Port: 6697
Encryption: SSL/TLS
Channel: #i/o
The full install guide is here:
This section is only the essential path.
As root:
apt update
apt install -y \
sudo \
git \
curl \
wget \
jq \
unzip \
zip \
ca-certificates \
perl \
build-essential \
make \
gcc \
pkg-config \
mariadb-server \
mariadb-client \
libmariadb-dev
systemctl enable --now mariadblibmariadb-dev provides the MariaDB Connector/C headers and mariadb_config
needed to compile the CPAN driver. It is a native build dependency, not a Perl
module package.
Do not install libdbi-perl, libdbd-mariadb-perl or
libdbd-mysql-perl for the supported installation path. ./configure installs
and verifies DBI, DBD::MariaDB and the remaining Perl modules through CPAN.
Optional but useful:
apt install -y screen tmux htop lsof net-tools iproute2 dnsutils rsync chromiumMediabot must not run as root.
adduser mediabot
su - mediabotExpected:
whoami
pwdmediabot
/home/mediabot
For the development tree:
cd /home/mediabot || exit 1
git clone https://github.com/teuk/mediabot_v3.git
cd /home/mediabot/mediabot_v3 || exit 1For the stable 3.3 release, use one of the published source archives:
mediabot_v3-3.3.tar.gz
mediabot_v3-3.3.tar.xz
Verify the download against mediabot_v3-3.3-SHA256SUMS or mediabot_v3-3.3-SHA512SUMS before extracting it.
The GitHub release uses the plain 3.3 tag, matching the established project
tag convention. See docs/RELEASING.md for the complete
artifact and verification workflow.
./configure is the supported fresh-install entry point.
Do not replace it with a manual cp mediabot.sample.conf mediabot.conf workflow.
cd /home/mediabot/mediabot_v3 || exit 1
./configuremediabot.sample.conf is a reference file. The installer now generates a
complete mediabot.conf directly from it, including all active safe defaults.
It never enables Partyline eval.
On a fresh installation it creates the database, installs dependencies, configures IRC/network data and validates schema drift.
On an existing installation it creates a timestamped backup, preserves current and custom values, adds missing defaults, normalizes duplicate INI keys and offers the database drift/migration workflow without automatically applying generated SQL.
Useful maintenance modes:
./configure --config mediabot.conf --sync-only
./configure --config mediabot.conf --drift-onlySee docs/CONFIGURE.md for the complete fresh/existing
workflow and safety rules.
After configure:
chmod 600 mediabot.conf
vi mediabot.confReview at least:
[main]
[mysql]
[connection]
[undernet] or [libera]
[metrics]
[antiflood]
[openai]
[anthropic]
[chromium]
[radio]
Never commit the real mediabot.conf.
Fresh installs use the current reference schema through the installer. Validate the newly created database with strict type checking:
cd /home/mediabot/mediabot_v3 || exit 1
perl tools/check_schema_drift.pl --conf=mediabot.conf --strict --types --indexesFor an existing instance, first generate a reviewable migration plan against the configuration that actually points to the target database:
perl tools/check_schema_drift.pl --conf=mediabot.conf --generate-migration --types --indexesFor example, on the Undernet instance:
perl tools/check_schema_drift.pl --conf=mbundernet.conf --generate-migration --types --indexesReview the output, back up the database, and apply only the required ordered
migrations from install/migrations/README.md. With --indexes, the drift
checker also compares every index required by install/mediabot.sql and can
generate non-destructive ADD INDEX statements for missing non-primary
indexes. Extra live-only indexes are intentionally ignored. Keep the explicit
index checks in the release checklist as an independent verification step.
After the migration work, run:
perl tools/check_schema_drift.pl --conf=mediabot.conf --strict --types --indexesDo not blindly apply historical migrations to a fresh install.
See:
From the project root:
cd /home/mediabot/mediabot_v3 || exit 1
perl -c mediabot.pl
find Mediabot -name '*.pm' -print -exec perl -I. -c {} \;
perl -c tools/check_schema_drift.pl
perl -c t/test_commands.pl
perl -c t/test_live.plAll files should report syntax OK.
Run the full static suite:
perl t/test_commands.pl --verboseProfile the suite without changing its execution order:
perl t/test_commands.pl --profileBy default the 20 slowest test files are reported. Choose another limit with:
perl t/test_commands.pl --profile-top 30Profiling is observational only: it does not parallelise, reorder or skip test files. Use the measured timings to guide test classification before considering parallel execution.
Run live tests when a local IRC test server is available:
perl t/test_live.pl --server localhost --channel '#testchan' --verboseIf t/full_test.sh is present, use it for a full validation with logs:
./t/full_test.sh -d /tmp/mediabot_testsExpected final result:
===== Final verdict =====
OK: static tests passed
OK: live tests passed
OK: logs written successfully
See:
Start in foreground first:
cd /home/mediabot/mediabot_v3 || exit 1
perl mediabot.pl --conf=mediabot.confFor production, use the systemd template unit (recommended):
sudo systemctl start mediabot@<instance>See tools/systemd/README.md for the systemd setup.
Do not switch to systemd until foreground startup is clean.
Watch for:
- missing Perl modules;
- database errors;
- IRC connection errors;
- charset warnings;
- missing config keys.
When the bot is connected to IRC, register and login by private message to the bot.
Example with a bot named mediabot:
/msg mediabot register <user> <password>
/msg mediabot login <user> <password>
Then verify with the configured command prefix:
<prefix>whoami
Examples:
m whoami
!whoami
.whoami
Do not use the public channel for the password.
Partyline is the Mediabot admin interface.
Connect locally with telnet:
telnet localhost 23456Partyline can also be reached through DCC CHAT or CTCP CHAT depending on your IRC client and bot configuration.
A local TCP Partyline session prompts interactively:
Mediabot Partyline
Please enter your nickname.
<user>
Enter your password.
Connected to Mediabot Partyline.
Once authenticated, Partyline commands start with a dot:
.help
.stat
.console 3
.floodstatus
.netsplit
.quit
See:
The generated mediabot.conf is local runtime configuration.
Important rules:
- do not commit
mediabot.conf; - do not commit real API keys;
- do not commit real database passwords;
- do not commit IRC passwords;
- keep
PARTYLINE_STATUS_JSONunique per bot instance; - keep
METRICS_PORTunique when multiple bots run on the same host; - review
CHARSET_MODEcarefully on legacy databases.
For fresh installs, CHARSET_MODE=utf8mb4 is recommended.
For old production databases, especially historical IRC instances, review charset behavior before changing it.
See:
If metrics are enabled:
[metrics]
METRICS_ENABLED=1
METRICS_BIND=127.0.0.1
METRICS_PORT=9108Validate:
curl -s http://127.0.0.1:9108/metrics | headUse one metrics port per bot instance.
Do not run Mediabot as root.
Do not leave temporary passwordless sudo on the mediabot user after installation.
If you granted temporary sudo access for installation, remove it before normal IRC use:
sudo rm -f /etc/sudoers.d/mediabot
sudo -kThen verify:
sudo -n true && echo "ERROR: sudo still active" || echo "OK: no passwordless sudo"A bot connected to IRC must not have passwordless root access.
Recent versions also avoid logging some runtime secrets such as DCC passive tokens and channel JOIN keys.
For security vulnerabilities, do not open a public Issue or disclose the problem in a public IRC channel.
Use GitHub's private vulnerability reporting feature and read:
Start with:
cd /home/mediabot/mediabot_v3 || exit 1
perl -c mediabot.pl
find Mediabot -name '*.pm' -print -exec perl -I. -c {} \;
perl tools/check_schema_drift.pl --conf=mediabot.conf --strict
./t/full_test.sh -d /tmp/mediabot_testsThen check:
tail -n 100 mediabot.logor instance-specific log paths.
Common issues are documented here:
- Report a bug
- Request a feature
- GitHub Discussions
- Support guidelines
- Contribution guidelines
- Code of Conduct
- Security policy
- Network: EpiKnet
- Server:
irc.epiknet.org - Port:
6697 - Encryption: SSL/TLS
- Channel:
#i/o
Mediabot v3 is free software licensed under the GNU General Public License version 3 or later.
SPDX license identifier: GPL-3.0-or-later
See LICENSE.md for the complete GNU GPL version 3 license text.