Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite of RSS module, two additional modules, other tweaks #230

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified willie/db.py
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion willie/irc.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def _ssl_recv(self, buffer_size):
""" Replacement for self.recv() during SSL connections. From:
http://evanfosmark.com/2010/09/ssl-support-in-asynchatasync_chat """
try:
data = self.read(buffer_size)
data = self.socket.read(buffer_size)
if not data:
self.handle_close()
return ''
Expand Down
16 changes: 8 additions & 8 deletions willie/modules/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def ty(willie, trigger):
mystr = str(mystr)
if (mystr.find(" no ") == -1) and (mystr.find("no ") == -1) and (mystr.find(" no") == -1):
willie.reply("You're welcome.")
ty.rule = '(?i).*(thank).*(you).*(willie|$nickname).*$'
ty.rule = '(?i).*(thank).*(you).*($nickname).*$'
ty.priority = 'high'
ty.rate = 30

Expand All @@ -41,7 +41,7 @@ def ty2(willie, trigger):

def ty4(willie, trigger):
ty(willie, trigger)
ty4.rule = '(?i).*(thanks).*(willie|$nickname).*'
ty4.rule = '(?i).*(thanks).*($nickname).*'
ty4.rate = 40


Expand All @@ -55,7 +55,7 @@ def yesno(willie, trigger):
willie.reply("no")
elif text[0] == 'no':
willie.reply("yes")
yesno.rule = '(willie|$nickname)\:\s+(yes|no)$'
yesno.rule = '($nickname)\:\s+(yes|no)$'
yesno.rate = 15


Expand All @@ -64,25 +64,25 @@ def ping_reply(willie, trigger):
text = text[1].split()
if text[0] == 'PING' or text[0] == 'ping':
willie.reply("PONG")
ping_reply.rule = '(?i)($nickname|willie)\:\s+(ping)\s*'
ping_reply.rule = '(?i)($nickname)\:\s+(ping)\s*'
ping_reply.rate = 30


def love(willie, trigger):
willie.reply("I love you too.")
love.rule = '(?i)i.*love.*(willie|$nickname).*'
love.rule = '(?i)i.*love.*($nickname).*'
love.rate = 30


def love2(willie, trigger):
willie.reply("I love you too.")
love2.rule = '(?i)(willie|$nickname)\:\si.*love.*'
love2.rule = '(?i)($nickname)\:\si.*love.*'
love2.rate = 30


def love3(willie, trigger):
willie.reply("I love you too.")
love3.rule = '(?i)(willie|$nickname)\,\si.*love.*'
love3.rule = '(?i)($nickname)\,\si.*love.*'
love3.rate = 30


Expand All @@ -93,7 +93,7 @@ def f_lol(willie, trigger):
randtime = random.uniform(0, 9)
time.sleep(randtime)
willie.say(random.choice(respond))
f_lol.rule = '(haha!?|lol!?)$'
#f_lol.rule = '(haha!?|lol!?)$'
f_lol.priority = 'high'


Expand Down
16 changes: 16 additions & 0 deletions willie/modules/join.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
"""
join.py - Channel Join Module
http://github.com/tcki
"""

def join(willie, trigger):
""".join <channel> - joins specified channel"""
if trigger.admin:
willie.write(['JOIN'], trigger.group(2))
join.commands = ['join']
join.example = '.join #channel'
join.priority = 'medium'

if __name__ == '__main__':
print __doc__.strip()
Empty file modified willie/modules/ping.py
100755 → 100644
Empty file.
22 changes: 22 additions & 0 deletions willie/modules/raw.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
"""
raw.py - Raw Command Module
http://github.com/tcki
"""

def raw(willie, trigger):
""".raw <command> - Sends specified text to server"""
if trigger.admin:
command = willie.safe(trigger.group(2))[:510] + '\r\n'
try:
willie.writing_lock.acquire()
willie.log_raw(command)
willie.send(command)
finally:
willie.writing_lock.release()
raw.commands = ['raw']
raw.example = '.raw COMMAND'
raw.priority = 'high'

if __name__ == '__main__':
print __doc__.strip()
Loading