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

>.< #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

>.< #16

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
21 changes: 4 additions & 17 deletions pingpong.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,18 @@ class PingPong(Module):
'ping': 'pong',
'*ping*': '*pong*',
'pink': 'ponk'
}
users = {
'tchab': [
"Für dich immer noch »pink«!",
"Klappe zu, Schwulibert!"]
}

}

def __init__(self, **keywords):
super(PingPong, self).__init__([MUC, MUC_MENTION], **keywords)

def muc_msg(self, msg, nick, **keywords):
key = msg.lower()
if key in self.mapping:
if nick in self.users:
self.send_muc(oneof(self.users[nick]))
else:
self.send_muc(self.mapping[key])
self.send_muc(self.mapping[key])

def muc_mention(self, msg, nick, **keywords):
key = msg.lower()
if key in self.mapping:
if nick in self.users:
self.send_muc("%s: %s" % \
(nick, oneof(self.users[nick])))
else:
self.send_muc("%s: %s" % \
(nick, self.mapping[key]))
self.send_muc("%s: %s" % \
(nick, self.mapping[key]))