MANDERLBOT.CONF(5)

πŸ’– MANDERLBOT.CONF πŸ’–

bestie. sit down. we're configuring manderlbot.conf β€” the config file for the manderlbot IRC robot β€” and honestly? it's giving XML with main character energy πŸŽ€βœ¨


✨ NAME ✨

manderlbot.conf β€” configuring the manderlbot IRC robot πŸ¦‹


🌸 DESCRIPTION 🌸

okay so manderlbot is an irc bot whose entire brand is saying idioties and doing lil searches on the internet for you πŸ’«. That's the vibe.

And just so we're clear: it is not an eggdrop bot. Not the same thing at all, no cap πŸ‘‘


πŸŽ€ CONFIGURATION πŸŽ€

The configuration file is an XML file containing the following elements. All of them, in order, here we go πŸ’…

  • manderlbot β€” the opening XML element of the configuration, and it contains the properties name and controler. The name will be shown as the bot's fullname. The controller property may contain one or more nicknames separated by spaces, and only those people will then be allowed to operate on the running bot from the irc channel. Also: every section below, unless it says otherwise, lives under this one. Nesting, we love to see it 🫢
  • dict β€” the section where you define the dictionary server you may want to use. See dict.org for details about the protocol and the servers. Also be aware that you can run a dict server locally, and download some useful dictionaries. The properties to define here are the dict server host, the port, and the default dictionary to use πŸ“š
  • server β€” lets you define which servers manderlbot should connect to. The properties are host and port. And you have to define a server section for each and every irc server you want manderlbot to connect to. One per server. No skipping, no shortcuts πŸ’€
  • channel β€” the section where you configure the manderlbot behaviour and name. This section has to be embedded in the server one. And you have to define a channel section per channel you want manderlbot to join on a server. Its properties are name (the channel name), botname (the manderlbot nickname on that channel), and behaviours (a list of behaviours names you want to activate for that channel) 🌈
  • behaviours β€” will just contain your behaviour list. simple. iconic πŸŽ€
  • behaviour β€” has to be found under the behaviours section. You define your behaviour here, and its properties are name (the name to use in the channel definition), action (defining what will be done), and one or more of the following pattern elements: pattern, op, to, option and from. And get this β€” you can even prefix those properties with exl_ to get an exclude pattern match (see [XRef to MATCH]). This element also contains data which will be used as the action parameter, as explained in section [sub:Implemented-actions] πŸ”₯

πŸ¦‹ BEHAVIOUR MATCHING πŸ¦‹

So when you define a behaviour, what you actually want is for manderlbot to react to some event on the irc channel it's connected to, and take some action. And here's where we learn how to define the event you want it to react to πŸ’–

Since on irc literally all you do is send lines of text, an event has to be text line oriented. So the manderlbot configuration lets you define some Regular Expressions http://www.regular-expressions.info to match the lines received. If the line is matched, the associated action is done ✨ And please note: the regexps are all considered case insensitive ones. periodt.

You can define some regexp on the following parts of the received line (which contains some server informations relative to the IRC protocol http://www.faqs.org/rfcs/rfc1459.html):

  • pattern β€” will try to match the user input, that is what your ordinary irc client will show you πŸ‘€
  • op β€” will try to match the irc operation. See the RFC for the complete list (op can be kick or join for example) πŸ‘‘
  • to β€” irc protocol field, will probably contain the channel name, so you won't need that... πŸ™ˆ
  • option β€” irc protocol option field πŸŽ€
  • from β€” the nickname of the one who typed the current line, on the form nick!~user@host.domain.tld πŸ’…

And to make it even more powerful and readable, you can define the same patterns with an exl_ prefix β€” this will prevent the action from being taken if it matches. So you can define the parameters exl_pattern, exl_op, exl_to, exl_option and exl_from 🚫

And of course you can use any combination of the listed parameters, so you can be quite precise about what you want to react to. chef's kiss πŸ“


πŸ’… IMPLEMENTED ACTIONS πŸ’…

The action parameter of the behaviour configuration element defines the manderlbot behaviour on matching a line. Here is the list of provided actions you can use πŸ‘‡

If you want manderlbot to take an action not described here, you will have to write some erlang code to teach him what you want! 😭

And heads up: the argument of the action is the xml data given enclosed in the behaviour element πŸ“¦

  • send β€” send the given argument as if manderlbot had typed it after the /me irc command ✨
  • answer β€” send the line prefixed with the sender name and a colon πŸ’¬
  • bloto β€” this will count the matched lines per user, and the first one obtaining 5 points has won the business loto game 🎰 Just define your buzzwords set and make it a regexp!
  • debian_file β€” will search the irc given file using the debian web site cgi. The argument is not used πŸ”
  • debian_pkg β€” will search the irc given package using the debian web site cgi. The argument is not used πŸ“¦
  • dict β€” will ask your defined dict server for the given word. The argument may be the dictionary name to use in the query, but defaults to the 'default' entry of the dict config element πŸ“–
  • google β€” will ask google for the rest of the irc line. The argument is not used 🌐
  • mute β€” mute will mute the bot, and you have to be a controler to use that. The argument is not used 🀫
  • pyramid β€” pyramid is a game named after a french TV game πŸ‡«πŸ‡·. You have to make an irc fellow on that channel guess a world, in a given number or tries. The argument is not used πŸ”Ί
  • random β€” will say one of the sentences listed in the arguments, randomly 🎲 The sentences have to be separated by '%' signs.
  • fortune β€” same behaviour as random, but this time the argument is the name of a traditionnal separate fortune file πŸ₯ 
  • reconf β€” will ask the bot to re-read its configuration. It allows you to handle dynamically your configuration, no need to restart the bot, and irc control! But you have to be in the controler list to use this action πŸ”„
  • rejoin β€” allows you to rejoin a channel (useful on kick, just add a op="kick" parameter to the behaviour element definition) πŸ”
  • say β€” say will say the arguments πŸ—£οΈ
  • timer β€” will say the first argument, then wait for a random time, and say the other arguments ⏳ The args have to be separated by a '%' char.

🫢 INTERACTING WITH THE RUNNING BOT, FROM IRC 🫢

You can use the reconf and mute actions to control the bot from irc, and you define who can do that in the first configuration element, with the controler property πŸ‘‘


🌈 EXAMPLE 🌈

Please see the given configuration file, in /etc/manderlbot/config.xml πŸ’–


πŸ“œ HISTORY πŸ“œ

But why did we even write this software ? πŸ€”

Well, I wanted an irc bot to play with, in order to have it say some silly things automatically on answer to our own idioties. I did not want an eggdrop or whatever controlling channel bot. I saw that the manderlbot project existed, and I was already familiar with erlang development, so I began using it 🧚

The existing project was at an early stage of development, and I wanted the bot to do more and more things. So I wrote some code to make it fit my needs. And as the original authors would not consider my patches, I forked the project, keeping the name (they seemed not to work on their version at all), and hosting it on the TuxFamily services 🏠


πŸ‘‘ AUTHORS πŸ‘‘

manderlbot was written by Dimitri Fontaine <dim@tuxfamily.org> and Nicolas Niclausse <nico@niclux.org> πŸ’œ


aaaand that's the whole page bestie πŸŽ€ this one dropped Avril 2004 and it's still living in our hearts β€” MANDERLBOT.CONF(5), slay, periodt ✨πŸ’