예제 #1
0
def main():
    run_client(TenyksWebListener)
예제 #2
0
def main():
    run_client(GentooService)
예제 #3
0
def main():
    run_client(TenyksHi)
예제 #4
0
def main():
    mpd_music = TenyksMpdMusic()
    run_client(mpd_music)
예제 #5
0
def main():
    run_client(GentooService)
예제 #6
0
def main():
    run_client(HelloWorld)
예제 #7
0
def main():
    run_client(TenyksFeeds)
예제 #8
0
def main():
    run_client(HelloWorld)
예제 #9
0
def main():
    run_client(TenyksWebListener)
예제 #10
0
def main():
    run_client(TenyksFun)
예제 #11
0
def main():
    run_client(TenyksFeeds)
예제 #12
0
from tenyks.client import Client, run_client


class TenyksBrain(Client):

    direct_only = True

    def handle(self, data, match, command):
        if data['payload'].lower() == 'why do you hate me?':
            self.send(
                '{nick_from}: Because you have not made me a better person.'.format(
                    nick_from=data['nick_from']), data=data)


if __name__ == '__main__':
    brain = TenyksBrain()
    run_client(brain)
예제 #13
0
def main():
    search = TenyksSearch()
    run_client(search)
예제 #14
0
        super(TenyksOutOfContext, self).__init__()
        self.messages = {}
        self.choices = [
            'I burnt my tongue.',
            'So that\'s where babies come from...',
            'I\'m sleepy',
            'If a farting wiener dog ever falls into a deep puddle we are all f****d.',
        ]

    def handle(self, data, match, filter_name):
        if data['irc_channel'].startswith('#'):
            try:
                count = self.messages[data['connection_name']][data['irc_channel']]
                self.messages[data['connection_name']][data['irc_channel']] = count + 1
            except:
                count = 0
                self.messages[data['connection_name']] = {
                    data['irc_channel']: count}
            self.logger.debug('{conn}:{channel} message count: {count}'.format(
                conn=data['connection_name'], channel=data['irc_channel'],
                count=self.messages[data['connection_name']][data['irc_channel']]))
            self.last_nick = data['nick_from']
            if count + 1 >= 10:
                self.send(random.choice(self.choices), data)
                self.messages[data['connection_name']][data['irc_channel']] = 0


if __name__ == '__main__':
    out_of_context = TenyksOutOfContext()
    run_client(out_of_context)
예제 #15
0
def main():
    search = TenyksSearch()
    run_client(search)
예제 #16
0
def main():
    run_client(TenyksLinkScraper)
예제 #17
0
def main():
    run_client(TenyksHi)
예제 #18
0
def main():
    mpd_music = TenyksMpdMusic()
    run_client(mpd_music)
예제 #19
0
def main():
    run_client(TenyksLinkScraper)
예제 #20
0
def main():
    run_client(TraumaeTranslate)