Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #18 from Bytespeicher/chaos_experiments
Browse files Browse the repository at this point in the history
Fix exception when config does not contain the right entries
  • Loading branch information
mkzero committed May 10, 2014
2 parents 5979d2e + 5240968 commit b0e97d7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ bytebot_config.py
*.swo
__pycache__
*.pyc
bytebot_config.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ commands via the registerCommand function.
* inspect
* json
* resource
* ssl
* ssl (for debian-based systems: this comes with python-openssl package, not as python-module)
* twisted
* urllib
* time
Expand Down
28 changes: 18 additions & 10 deletions plugins/autoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ class autoop(Plugin):
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)
if 'autoop' in BYTEBOT_PLUGIN_CONFIG.keys():
if 'hostmask' in BYTEBOT_PLUGIN_CONFIG['autoop'].keys():
if channel in BYTEBOT_PLUGIN_CONFIG['autoop']['hostmask'].keys():
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" % (prefix, channel))
else:
print("Channel name %s not in bytebot_config.py" % channel)
else:
print("BYTEBOT_PLUGIN_CONFIG in bytebot_config.py has no 'hostmask' section")
else:
print("User %s not in autoop list %s" % (prefix, channel))
print("BYTEBOT_PLUGIN_CONFIG in bytebot_config.py has no 'autoop' section")

0 comments on commit b0e97d7

Please sign in to comment.