def list(self, channels=None, server=""): """Send a LIST command.""" command = "LIST" channels = ",".join(always_iterable(channels)) if channels: command += ' ' + channels if server: command = command + " " + server self.send_raw(command)
def part(self, channels, message=""): """Send a PART command.""" channels = always_iterable(channels) cmd_parts = [ 'PART', ','.join(channels), ] if message: cmd_parts.append(message) else: cmd_parts.append(config['VERSION']) self.send_raw(' '.join(cmd_parts))
def whois(self, targets): """Send a WHOIS command.""" self.send_raw("WHOIS " + ",".join(always_iterable(targets)))
def names(self, channels=None): """Send a NAMES command.""" tmpl = "NAMES {channels}" if channels else "NAMES" channels = ','.join(always_iterable(channels)) self.send_raw(tmpl.format(channels=channels))