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))