예제 #1
0
파일: bot.py 프로젝트: ohaz/TeamspeakIRC
 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)
예제 #2
0
파일: bot.py 프로젝트: ohaz/TeamspeakIRC
 def topic(self, topic, channel=None):
     if not channel:
         channel = self.current_channel
     Basic.topic(self, channel, topic)
예제 #3
0
파일: bot.py 프로젝트: ohaz/TeamspeakIRC
 def privmsg(self, msg, reciever=None):
     if not reciever:
         reciever = self.current_channel
     Basic.privmsg(self, msg, reciever)
예제 #4
0
파일: bot.py 프로젝트: ohaz/TeamspeakIRC
 def join(self, channel):
     Basic.join(self, channel)
     self.current_channel = channel
     log.info('Joined {}'.format(channel))
예제 #5
0
파일: bot.py 프로젝트: ohaz/TeamspeakIRC
 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)
예제 #6
0
파일: bot.py 프로젝트: ohaz/TeamspeakIRC
 def send_queue(self):
     for line in self.queue:
         Basic.send(self, line)
     self.queue = []