def _handle_mode(self, message): prefix, command, parameters = Irc.split_message(message) # Auto-join servers after MODE received from NickServ. if prefix.lower() == ':nickserv': for channel in self.config['channels']: self._send_message(Irc.join(channel))
def join(self, channel, password=None): """ join a channel .. use optional password. """ result = Irc.join(self, channel, password) if result != 1: return result if not self.channels.has_key(channel): # init channel data self.channels.setdefault(channel, {}) chan = self.channels[channel] # if password is provided set it got = False if password: chan['key'] = password got = True # check for control char .. if its not there init to ! if not chan.has_key('cc'): chan['cc'] = self.cfg['defaultcc'] or '!' got = True if not chan.has_key('perms'): chan['perms'] = [] got = True if not chan.has_key('mode'): chan['mode'] = "" got = True if got: self.channels.save() self.getchannelmode(channel) return 1
def _join_event(self, event): event_type, data = event message = data[0][0] destination = data[0][1] if data[0][2][0] == '#': destination = data[0][2] channel = message.split(" ")[1] if channel[0] == '#': self._send_response("Joining {}".format(channel), destination) self._send_message(Irc.join(channel))
def join(self, channel, password=None): """ join a channel .. use optional password. """ result = Irc.join(self, channel, password) if result != 1: return result chan = ChannelBase(channel, self.botname) got = False if password: chan.setkey('IRC',password) got = True if not chan.data.cc: chan.data.cc = self.cfg.defaultcc or '!' got = True if not chan.data.perms: chan.data.perms = [] got = True if not chan.data.mode: chan.data.mode = "" got = True if got: chan.save() self.getchannelmode(channel) return 1
def join(self, channel, password=None): """ join a channel .. use optional password. """ chan = ChannelBase(channel, self.cfg.name) if password: chan.data.key = password.strip() chan.save() result = Irc.join(self, channel, chan.data.key) if result != 1: return result got = False if not chan.data.cc: chan.data.cc = self.cfg.globalcc or '' got = True if not chan.data.perms: chan.data.perms = [] got = True if not chan.data.mode: chan.data.mode = "" got = True if got: chan.save() self.getchannelmode(channel) return 1
def join(self, channel, password=None): """ join a channel .. use optional password. """ chan = ChannelBase(channel, self.cfg.name) if password: chan.data.key = password.strip() chan.save() # logging.warn("%s - using key %s for channel %s" % (self.cfg.name, chan.data.key, channel)) result = Irc.join(self, channel, chan.data.key) if result != 1: return result got = False if not chan.data.cc: chan.data.cc = self.cfg.defaultcc or "!" got = True if not chan.data.perms: chan.data.perms = [] got = True if not chan.data.mode: chan.data.mode = "" got = True if got: chan.save() self.getchannelmode(channel) return 1