Our goal is to set a variable topic. Example:
<@owner> !topic We are back in Universe 32! ChanServ changes topic to: 'Channel from the Alliance blabla. News: We are back in Universe 32! | enjoy and idle here |' <@owner> !topic We're at war with the alliance blabla1 ChanServ changes topic to: 'Channel from the Alliance blabla. News: We're at war with the alliance blabla1 | enjoy and idle here |' [/quote]
You can see that only the part after “News:” has been changed.
How do you get this?
It’s quite easy, really. You can set the Topicmask with SET TOPICMASK. However, you’ll need to replace the variable part with a wildcard, for which we use the asterisk ( * ). If you want to use another asterisk in the topic, you have to use \*! later on, the \ will not be visible. The setting for the topicmask in our example would be:
SET TOPICMASK Channel from the Alliance blabla. News: * | enjoy and idle here |
Should I be careful with something?
Now you have set your topicmask. However, when users do TOPIC 'bla', the topic is changed to 'bla', they will just overwrite your TOPICMASK setting.
This problem can be fixed: Use the ''SET ENFTOPIC'' to do this (for a more detailed description, please click the link). SET ENFTOPIC could be set on 501 (only the owner is able to set it to 501), so even the owner cannot overwrite the TOPICMASK.
Yes. It is useful to set a DEFAULTTOPIC that matches the TOPICMASK. In our example:
'Channel from the Alliance blabla. News: Nothing | enjoy and idle here |'
This is useful because the topic will be changed automatically to the DEFAULTOPIC if someone uses the TOPIC (!topic) command without parameters. You can set the Defaulttopic with SET DEFAULTTOPIC.