1 · Configuration - teuk/mediabot_v3 GitHub Wiki

Default configuration file

The configure script should have generated a configuration file like this (default mediabot.conf)


[main]
MAIN_PROG_NAME=Mediabot
MAIN_PROG_NAME_LOWER=mediabot
MAIN_PID_FILE=/home/mediabot/mediabot_v3/mediabot.pid
MAIN_LOG_FILE=/home/mediabot/mediabot_v3/mediabot.log
MAIN_PROG_BIRTHDATE=1659431057
MAIN_PROG_TZ=America/New_York
MAIN_PROG_URL=http://www.domain.tld/mediabot
MAIN_PROG_QUIT_MSG=So long and thanks for all the fish !
MAIN_PROG_DEBUG=0
MAIN_PROG_MAXLEN=400
MAIN_SQL_FLOOD_PROTECT_COUNT=10
MAIN_SQL_FLOOD_PROTECT_DURATION=120
MAIN_PROG_INITIAL_TRIGGER=1
NICK_TRIGGER=1
MAIN_PROG_CMD_CHAR=!

[mysql]
MAIN_PROG_DDBNAME=mediabot
MAIN_PROG_DBUSER=mediabot
MAIN_PROG_DBPASS=XXXXXXXXXXXXXX
MAIN_PROG_DBHOST=localhost
MAIN_PROG_DBPORT=3306

[connection]
CONN_SERVER_NETWORK=Undernet
CONN_NICK=mediabot
CONN_NICK_ALTERNATE=mediabot_
CONN_USERNAME=mediabot
CONN_IRCNAME=mediabot
CONN_USERMODE=+i
CONN_NETWORK_TYPE=1

[undernet]
[email protected]
UNET_CSERVICE_USERNAME=
UNET_CSERVICE_PASSWORD=
UNET_CSERVICE_HOSTMASK=users.undernet.org

The default debug level is set to 0, but you can increase it (0 to 5) for more verbosity in mediabot.log

Ex :

MAIN_PROG_DEBUG=3

The public commands are invoked using defined MAIN_PROG_CMD_CHAR

Ex :

06:17:20     @foo | !version
06:17:20 mediabot | Mediabot3.0dev-20220818_134410

By default MAIN_PROG_INITIAL_TRIGGER is set to 1, it means you can invoke public commands with the nick inital of the bot (here 'm' for mediabot)

06:20:16     @foo | m version
06:20:16 mediabot | Mediabot3.0dev-20220818_134410

And by default NICK_TRIGGER is set to 1, so you can also invoke public commands with the nick of the bot (here 'mediabot')

06:22:46     @foo | mediabot version
06:22:46 mediabot | Mediabot3.0dev-20220818_134410

Sample configuration file

Have a look at https://github.com/teuk/mediabot_v3/blob/master/mediabot.sample.conf to see what you can add in this file



The first step is to register your user as owner of the bot, see General Commands https://github.com/teuk/mediabot_v3/wiki/2-%C2%B7-General-commands


PHP Interface configuration

Apache directives (you will need ton install php and php-mysql packages too)

Alias /mediabot /home/mediabot/mediabot_v3/htdocs
<Directory "/home/mediabot/mediabot_v3/htdocs">
   Options Indexes FollowSymlinks
   AddDefaultCharset utf-8
   AllowOverride None
   Require all granted
</Directory>

Edit both /home/mediabot/mediabot_v3/htdocs/includes/conf/config.php and /home/mediabot/mediabot_v3/htdocs/mbadm/includes/conf/config.php

Then restart Apache

systemctl restart apache2

Hint : always check your error.log and access.log files to check for errors

⚠️ **GitHub.com Fallback** ⚠️