diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 7e3cf92..43063e0 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -1088,8 +1088,10 @@ class ClientbotWrapperProtocol(IRCCommonProtocol): channel = args[1] # Send out the hook. We don't worry about repeats since these modes don't need to be # enumerated more than once per JOIN anyways. - return {'target': channel, 'parse_as': 'MODE', - 'modes': [('+%s' % banmode, m[1]) for m in self.channels[channel].modes if m[0] == banmode]} + modes = [('+%s' % banmode, m[1]) for m in self.channels[channel].modes if m[0] == banmode] + if modes: + return {'target': channel, 'parse_as': 'MODE', + 'modes': modes} def handle_346(self, *args): """