aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2010-02-18 21:57:28 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2010-02-18 21:57:28 +0000
commit9ef3fec04e38e56fe62351fe26f0b78289285cc3 (patch)
treee687b09cda8021c2e9673c2f3f6d378f6d871b28
parentFixup tricks. (diff)
downloadrbot-gentoo-9ef3fec04e38e56fe62351fe26f0b78289285cc3.tar.gz
rbot-gentoo-9ef3fec04e38e56fe62351fe26f0b78289285cc3.tar.bz2
rbot-gentoo-9ef3fec04e38e56fe62351fe26f0b78289285cc3.zip
Make the syntax stricter for #gentoo abuse.
-rw-r--r--gentoo-search.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/gentoo-search.rb b/gentoo-search.rb
index 46cc8f2..485d7a3 100644
--- a/gentoo-search.rb
+++ b/gentoo-search.rb
@@ -6,7 +6,10 @@ GOOGLE_WAP_LINK = /<a href="(?:.*?u=(.*?)|(http:\/\/.*?))">(.*?)<\/a>/im
class GentooSearchPlugin < Plugin
def listen(m)
#return if m.address?
- return if m.message !~ /^\? (.+)$/i
+ # if the channel is #gentoo, you MUST use "g? $QUERY" to cut down on spam.
+ return if m.target.to_s == "#gentoo" && m.message !~ /^g\? (.+)$/
+ # Otherwise, you can use "g? $QUERY" or "? $QUERY" to search.
+ return if m.message !~ /^g?\? (.+)$/i
search = $1
#m.reply "doing search for #{search}"
params = {}