"define": c.defineq,
"google": c.googleq,
"url": (c.urlq,urldb),
+ "nsfw": (c.nsfwq,urldb),
+ "nws": (c.nsfwq,urldb),
"units": c.unitq,
"help": c.helpq,
# "game": (c.gameq,game),
#(?:) is a regexp that doesn't group
urlre = re.compile("((?:(?:http)|(?:nsfw))s?://[^ ]+)( |$)")
+hturlre= re.compile("(http)(s?://[^ ]+)( |$)")
urlcomplaints = ["a contemporary","an interesting","a fascinating","an overused","a vastly overused"]
### Deal with /msg bot url or ~url in channel
urlstring.replace(middle,"/hi/")
return urlstring
+# automatically make nsfw urls for you and pass them on to url
+def nsfwq(bot,cmd,nick,conn,public,urldb):
+ if (not hturlre.search(cmd)):
+ bot.automsg(False,nick,"Please use 'nsfw' only with http or https URLs")
+ return
+ newcmd=hturlre.sub(nsfwify,cmd)
+ urlq(bot,newcmd,nick,conn,public,urldb)
+
+def nsfwify(match):
+ a,b,c=match.groups()
+ return 'nsfw'+b+c
#get tweet text
def twitterq(bot,cmd,nick,conn,public,twitapi):
<li><a href="#karmadel">karmadel</a></li>
<li><a href="#karmalist">karmalist</a></li>
<li><a href="#list">list</a></li>
+<li><a href="#nsfw">nsfw</a></li>
+<li><a href="nws">nws</a></li>
<li><a href="#quiet">quiet</a></li>
<li><a href="#quit">quit</a></li>
<li><a href="#reload">reload</a></li>
class="code">/msg</span>) a list of the commands Servus
understands</p>
+<h3><a name="nsfw">nsfw</a></h3>
+<p>This command is the same as <a href="#url">url</a>, only you should
+use it for URLs that are not work-safe. Servus will replace the "http"
+in your URL with "nsfw", before passing it to <a href="#url">url</a>.</p>
+
+<h3><a name="nws">nws</a></h3>
+<p>This is an alias for <a href="nsfw">nsfw</a>.</p>
+
<h3><a name="quiet">quiet</a></h3>
<p>This command prevents the use of <span
class="code">trout</span>, <span class="code">flirt</span>, and <span