Skip to content

Commit

Permalink
the seen database now stores kicks
Browse files Browse the repository at this point in the history
  • Loading branch information
ask-compu committed Mar 15, 2016
1 parent ba30117 commit 3823b72
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions modules/seen.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def seen(phenny, input):
phenny.say(nick + ' was last seen quitting with message "' + message + '" on ' + seentime)
elif event == "NICK":
phenny.say(nick + ' was last seen switching to the nick ' + channel + ' on ' + seentime)
elif event == "KICK":
messagekick = message.split("----------")
phenny.say(nick + ' was last seen being kicked by ' + messagekick[1] + ' in ' + channel + ' with message "' + messagekick[0] + '" on ' + seentime)
if gotresults == True:
c.close()
seen.commands = ['seen']
Expand All @@ -116,6 +119,13 @@ def seenstore(phenny, input, event):
message = "None"
else:
message = input.group()
if event == "KICK":
args = input.args
kicker = input.nick
nick = args[1]
message = message + "----------" + kicker


seen_db = os.path.join(os.path.expanduser('~/.phenny'), 'seen.db')
seen_conn = db_connect(seen_db)
conn = db_connect(seen_db)
Expand Down Expand Up @@ -146,6 +156,13 @@ def seennick(phenny, input):
seennick.rule = r'(.*)'
seennick.priority = 'low'

def seenkick(phenny, input):
event = "KICK"
seenstore(phenny, input, event)
seenkick.event = "KICK"
seenkick.rule = r'(.*)'
seenkick.priority = 'low'

def seenquit(phenny, input):
event = "QUIT"
seenstore(phenny, input, event)
Expand Down

0 comments on commit 3823b72

Please sign in to comment.