Topic Masking Guide
(→Locking Your Topic) |
|||
Line 58: | Line 58: | ||
You may also want to set TOPICSNARF to 501 to prevent your DEFAULTTOPIC from being changed by anyone (including yourself) you can do this via the following command. | You may also want to set TOPICSNARF to 501 to prevent your DEFAULTTOPIC from being changed by anyone (including yourself) you can do this via the following command. | ||
- | '''<code>.SET TOPICSNARF</code>''' | + | '''<code>.SET TOPICSNARF 501</code>''' |
== Confused? == | == Confused? == |
Revision as of 16:53, 22 November 2009
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
As the channel owner, you may notice that a certain level (200) and up by default can set your topic. Lets say you want only 300 and up to be able to change your topic.
To acheive this, issue the following command:
.SET ENFTOPIC 300
You have now set the enftopic (short for enforce topic) to 300.
Your topic should now be locked, and using ChanServ's TOPIC command should put the given string (text) in the topic where your wildcard (*) was placed, as in our example earlier in this guide. You can view your current TOPICMASK and ENFTOPIC level by using ChanServ's SET command. For example, .SET
You may also want to set TOPICSNARF to 501 to prevent your DEFAULTTOPIC from being changed by anyone (including yourself) you can do this via the following command.
.SET TOPICSNARF 501
Confused?
If you still aren't too sure on how topic masking works after reading this guide, that's okay! Our friendly support staff in #support will be more than happy to answer any questions you may have.