From 85fab4462f0057b90ca711d6f6fc86a97c21a672 Mon Sep 17 00:00:00 2001 From: Maik Kulbe Date: Tue, 25 Mar 2014 22:14:52 +0000 Subject: [PATCH] Updated autoop for new hostmask filter. Part of #10 --- plugins/autoop.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/autoop.py b/plugins/autoop.py index 721a0db..af0afbb 100644 --- a/plugins/autoop.py +++ b/plugins/autoop.py @@ -5,10 +5,17 @@ from bytebot_config import BYTEBOT_PLUGIN_CONFIG class autoop(Plugin): - def onUserJoined(self, irc, user, channel): - if user in BYTEBOT_PLUGIN_CONFIG['autoop'][channel]: + def onIrc_JOIN(self, irc, prefix, params): + channel = params[0] + user = prefix.split('!')[0] + + if prefix in BYTEBOT_PLUGIN_CONFIG['autoop']['hostmask'][channel]: + print("Giving user %s +o on channel %s" % (prefix, channel)) + irc.mode(channel, True, 'o', user=user) + irc.msg(channel, "Hey, %s, it seems like you're a nice guy. Let me op you hard" % user) + if user in BYTEBOT_PLUGIN_CONFIG['autoop']['name'][channel]: print("Giving user %s +o on channel %s" % (user, channel)) irc.mode(channel, True, 'o', user=user) irc.msg(channel, "Hey, %s, it seems like you're a nice guy. Let me op you hard" % user) else: - print("User %s not in autoop list %s" % (user, channel)) + print("User %s not in autoop list %s" % (prefix, channel))