def run(args): brain = cobe.brain.Brain("cobe.store") client = IrcClient(brain, args.ignored_nicks, args.only_nicks) client.connect(args.server, args.port, args.nick) for channel in args.channel: client.join(channel) client.start()
def run(args): brain = cobe.brain.Brain("cobe.store") client = IrcClient(brain, args.encoding, args.random_replies, args.deaf, args.ignored_nicks, args.only_nicks) client.connect(args.server, args.port, args.nick, args.password) for channel in args.channel: client.join(channel) client.start()
def run(args): brain = cobe.brain.Brain("cobe.store") client = IrcClient(brain, args.owners, args.ignored, args.trainers, args.no_reply) client.connection.buffer_class.errors = "ignore" client.connect(args.server, args.port, args.nick, args.password, args.username, args.realname) for channel in args.channel: client.join(channel) client.start()
names.put(StopIteration) wid = self.client.watch(collect_names) self.client._conn.names([self.channame]) return consume(names) def leave(self): self.client._conn.part([self.channame]) self.client.unwatch(self._onmsg_wid) self.client = Closed if __name__ == "__main__": with IRCClient("irc.inter.net.il", 6667, "moishe328") as client: # channels = list(client.list_channels()) chan = client.join("test873") names = list(chan.list_users()) def listener(msgtype, source, text): print ">>", msgtype, source, text chan.listen(listener) chan.send("hello everybody") chan.send_to("tomer", "sup?") while True: inp = raw_input(">>> ") if not inp.strip(): continue if inp.strip() == "quit": break res = eval(inp)
names.put(StopIteration) wid = self.client.watch(collect_names) self.client._conn.names([self.channame]) return consume(names) def leave(self): self.client._conn.part([self.channame]) self.client.unwatch(self._onmsg_wid) self.client = Closed if __name__ == "__main__": with IRCClient("irc.inter.net.il", 6667, "moishe328") as client: #channels = list(client.list_channels()) chan = client.join("test873") names = list(chan.list_users()) def listener(msgtype, source, text): print ">>", msgtype, source, text chan.listen(listener) chan.send("hello everybody") chan.send_to("tomer", "sup?") while True: inp = raw_input(">>> ") if not inp.strip(): continue if inp.strip() == "quit": break res = eval(inp)