Beispiel #1
0
 def __init__(self, ip, port, nickname):
     # vars
     Basic.__init__(self)
     self.nickname = nickname
     self.current_channel = None
     self.queue = []
     self.loop_threads = []
     # calls
     self.connect(ip, port)
     self.nick(nickname)
     self.user(nickname, nickname, nickname, nickname)
Beispiel #2
0
 def topic(self, topic, channel=None):
     if not channel:
         channel = self.current_channel
     Basic.topic(self, channel, topic)
Beispiel #3
0
 def privmsg(self, msg, reciever=None):
     if not reciever:
         reciever = self.current_channel
     Basic.privmsg(self, msg, reciever)
Beispiel #4
0
 def join(self, channel):
     Basic.join(self, channel)
     self.current_channel = channel
     log.info('Joined {}'.format(channel))
Beispiel #5
0
 def disconnect(self, quitmsg=None):
     irc.events.fire('disconnected', self)
     self.quit(quitmsg)
     # send queue (to prevent "EOF from client")
     self.send_queue()
     Basic.disconnect(self)
Beispiel #6
0
 def send_queue(self):
     for line in self.queue:
         Basic.send(self, line)
     self.queue = []