def main(): run_client(TenyksWebListener)
def main(): run_client(GentooService)
def main(): run_client(TenyksHi)
def main(): mpd_music = TenyksMpdMusic() run_client(mpd_music)
def main(): run_client(HelloWorld)
def main(): run_client(TenyksFeeds)
def main(): run_client(TenyksFun)
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)
def main(): search = TenyksSearch() run_client(search)
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)
def main(): run_client(TenyksLinkScraper)
def main(): run_client(TraumaeTranslate)