+
+ if target == self.nick:
+ if len(pieces) > 1:
+ chanword = pieces[1]
+ if chanword[0] == '#':
+ chan = self.parent.channel(chanword)
+ if chan is not None: #if chan is still none, there's no bot on "chanword", and chanword is used as a parameter.
+ pieces.pop(1)
+
+ else: # message was sent to a channel
+ chan = self.parent.channel(target) #TODO check if bot's on channel --- in Erebus.channel() maybe?
+ try:
+ if msg[0] == '*': # message may be addressed to bot by "*BOTNICK" trigger?
+ if pieces[0][1:].lower() == self.nick.lower():
+ pieces.pop(0) # command actually starts with next word
+ msg = ' '.join(pieces) # command actually starts with next word
+ elif not triggerused:
+ return # not to bot, don't process!
+ except IndexError:
+ return # Fix if you feel like it /BiohZn
+