Log in | Back to darenet.org

Topic Masking Guide

Topic masks allow you to set a specific pattern that ChanServ will force all topics to follow. However, before we go further into detail, let's talk about wildcards as you will need a firm understanding of them to effectively use ChanServ's topic masking feature.

In This Guide:

Wildcards

A wildcard is a character that may be substituted for any of a defined subset of all possible characters. Whether the wildcard character represents a single character or a string of characters must be specified.

A multi-character wildcard is defined by the * character, while a single-character wildcard is defined by the ? character.

These wildcards operate in the same fashion as they did in DOS or Unix, if you remember using them in either of these environments. Likewise, if you have ever used wildcards in channel bans, it is essentially the same concept.

For simplicity, and the purpose of this guide, we will only be concerned with the multi-character wildcard (*).

Now, let's take a look at an example.

In Linux, to delete a file, you might execute the following command:

rm OldNotes.*

In the example above, the system would delete all files called OldNotes that had any extension. Thus OldNotes,png, OldNotes.jpg, OldNotes.doc, OldNotes.txt and so on would be deleted. Therefore, the wildcard * essentially means anything, OldNotes.anything.

Setting Your Channel Topic

Now that we understand what wildcards are, and what they do, let's apply them to topic masking.

Say, for example, we wanted our channel's topic to be:

Welcome to the DareNET IRC Network's Main Channel. NEWS: Check out us out on the web @ http://www.darenet.org

We would like to prevent everything before NEWS: from being changed, but allow anything to be added after it whenever someone uses ChanServ's TOPIC command. This is where topic masking comes in.

To illustrate what we mean, here's an example:

 <SomeOp> .topic Welcome JoeCool to staff!

* ChanServ changes topic to Welcome to the DareNET IRC Network's Main Channel. NEWS: 
  Welcome JoeCool to staff!

Notice that the topic remained the same, except for the part after NEWS:, which was replaced with what SomeOp typed. This method of topic alteration is what we refer to as topic masking. So, how did we acheive this? Well, we took advantage of the wildcard * to set our topic mask in the way that would satisfy our needs.

Using ChanServ's SET command with the TOPICMASK option, we set the following topic mask:

.SET TOPICMASK Welcome to the DareNET IRC Network's Main Channel. NEWS: *

Notice, we used the multi-character wildcard * after NEWS:, which basically means allow anything here.

Locking Your Topic Mask

As the channel owner, you may notice that even though a topic mask is set for your channel, changing your topic still replaces the entire message. This is because ChanServ grants the channel owner override for changing the topic, which allows you to change it in its entirety. However, there is a way around this, which we'll explain below.

As channel owner, you can tell ChanServ that you do not want to override the topic mask, that you in fact want to always use the wildcard.

To do this, we would issue the following command:

.set enftopic 501

Now, we chose to set enftopic (short for "enforce topic") to 501 because as owner of the channel, you have an access level of 500. Since we always want to use the topic mask, we set enftopic to an access level higher than ourselves, so it will always be used. This will keep the topic in tact, and only allow us to change the wildcard section of the topic mask (*).

Your topic should now be locked, and any .topic command should put the given string (text) in the topic where your wildcard (*) was placed, as in our example used earlier in this guide.

You can view your current topic mask and enftopic level by using the .set command in your channel.

Changing Your Topic Mask

Before you can change your topic mask (by using the steps shown above), we must first change our enftopic level back to at least 500. Once we have done so, we can then safely change the topic mask. When we're through, we can then set enftopic back to 501.

Confused?

If you are still unsure on how to topic masking operates, feel free to stop by #support and ask. Our support staff will be more than happy to help to you.