-
Notifications
You must be signed in to change notification settings - Fork 5
Configuration
If you just want a barebone PHP bot connected to an IRC server installed on the same machine, this bot will run out of the box. This isn't actually useful though as, by itself, it will initiate a connection and do nothing more.
You may (should) want to configure the bot to do things, for example identify with NickServ, oper, maybe get information from your ShoutCast radio, or just make someone a coffee. Either way by itself it does nothing and is ultimately a template designed to help you make integrating your IRCd with other things easier.
And so, you'll firstly want to check out the configuration.
If you haven't already, duplicate the example configuration (example.config.php
) and call it gateway.config.php
Assuming you followed the configuration portion of the installation instructions would be something like this from your command line (change 'ircd' to non-root username if not 'ircd'):
$ cp /home/ircd/Valeyard/example.config.php /home/ircd/Valeyard/gateway.config.php
Change directory to your Valeyard directory
$ cd /home/ircd/Valeyard
Edit your configuration file:
$ nano gateway.config.php
The configuration options should be pretty self-explanatory, although it should be worth noting at this point that you don't load modules from the configuration file, please see 'Modules' below for loading modules.
When you are in gateway.config.php you'll see that the configuration options are stored in a local variable $cf
.
Within this are several options you can change, and some which don't work yet because it's still being developed :>
When set to 'on'
will show all the raw client information in your commandline interface.
You can comment this out or set it to 'off'
to turn it off.
This is the username (nick
name) of the bot.
This is the part of the user that shows in `ident@host'
This is only required in SSL circumstances to bind to for verifying your server name If connecting with no SSL, (i.e. locally) you don't need to touch this lol
Otherwise known as GECOS, and shows in your WHOIS and various other /WHO* related places
This is the password that the bot will use to identify with, either to NickServ directory or through SASL.
Please note: This function is not automatic, you should load the function in src/module.php
if you want to use it, using:
include "src/ns_identify.php";
This email is used when registering to NickServ if it's not already registered. It's not used anywhere else.
The credentials the bot should use for /OPER
when connected to the server.
Your bot will need to have oper if you wish to use modules like unrealircd/stats.php
which require oper.
Having oper can also help if your bot sends more messages over IRC than the average client, such as if you used src/third/help.php
which sends a burst of notices.
The IP address of the IRC server you want the bot to connect to. If you want to use an SSL connection you must make note of the following:
- Do not use an IP address, use a server name, i.e.
irc.server.com
- Prefix the server name with
ssl://
like `ssl://irc.server.com
The port of the IRC server you want to connect to.
Not really used yet but would come in handy when running multiple bots from one template.
The caps you want to send during CAP REQ
in space delimited tokens. For example if you want to sasl and away-notify you can change it to be 'away-notify sasl'
Uncomment this line and change it if your IRC server has a password set in its allow
block
If you want to use SQL you should specify the IP of the server here. I assume it is running on the normal port.
The username that the bot will use when connecting to the SQL database (this is not your nick
)
The password for the user above.
The database we use (we use a single database for everything)
Either one of
-
server
, where it will join all channels listed in the/LIST
output. -
chanserv
, where it will ask ChanServ what rooms are registered and join those. -
sql
, checks with Anope's SQL table 'chans' and joins them.
In order to change/add what modules are loaded and in what order, you can simply add them into src/modules.php
I would recommend loading them underneath the core files, unless you really know what you are doing.
To load a module into the bot, include them like this for example to load coffeelol.php
in the src/modules/third
directory:
include "src/modules/third/coffeelol.php";