4.7 Dealing with Bridge Bots

It is increasingly common for IRC channels to be “bridged” onto other networks such as XMPP, Matrix, etc. Sometimes the software does a good job at mapping each non-IRC user into an IRC user, but more often than not it doesn’t. In that case you might receive a message like:

09:47 <bridge> <john> I am not on IRC

where ‘bridge’ is a bot responsible for sending messages back and forth between networks, and ‘john’ is the user name of someone on a different network. Note that the bot indicates this within the message (<john> I am not on IRC) that appears in your chat buffer.

If this annoys you, the user option rcirc-bridge-bot-alist may be of use. It consists of descriptions of what users are these kinds of “bridge bots” and how they format their messages. To handle the above example, we might set the user option to:

(setopt rcirc-bridge-bot-alist
        '(("bridge" . "<\\(.+?\\)>[[:space:]]+")))

If there is an entry for the current user, rcirc will take the associated regular expression and try to find a match in the message string. If it manages to find anything, the matching expression is deleted from the message. The regular expression must contain at least one group that will match the user name of the bridged message. This will then be used to replace the username of the bridge bot.