예제 #1
0
 def __init__(self, command='fight'):
     super(self.__class__, self).__init__(command=command)
     super().__init__()
     Observer.__init__(self)
     self.bang = ["BANG", "POW", "SLAM", "WHACK", "SLAP", "KAPOW", "ZAM", "BOOM"]
     self.blow_type = ["devastating", "destructive", "ruthless", "damaging", "ruinous", "catastrophic", "traumatic", "shattering", "overwhelming", "crushing", "fierce", "deadly", "lethal", "fatal", "savage", "violent"]
     self.victory = ["wins", "stands victorious", "triumphs", "conquers", "is the champion", "is the victor" ]
     self.blow = ["uppercut", "hammerfist", "elbow strike", "shoulder strike", "front kick", "side kick", "roundhouse kick", "knee strike", "butt strike", "headbutt", "haymaker punch", "palm strike", "pocket bees"]
예제 #2
0
 def __init__(self, command='giphy'):
     super(self.__class__, self).__init__(command=command)
     Observer.__init__(self)
     self.headers = {
         'User-Agent':
         'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19'
     }
     self.base_url = 'http://api.giphy.com/v1/gifs'
예제 #3
0
 def __init__(self,
              command='hello',
              patterns=(
                  ('^hello!$', 'say_hello_world'),
                  ('^ni!$', 'say_ni'),
              )):
     super(self.__class__, self).__init__(command=command,
                                          patterns=patterns)
     Observer.__init__(self)
예제 #4
0
파일: urban.py 프로젝트: z/tautbot
 def __init__(self, command='urban', aliases=(('urand', 'urban'), )):
     super(self.__class__, self).__init__(command=command, aliases=aliases)
     Observer.__init__(self)
     self.headers = {
         'User-Agent':
         'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19',
         'Referer': 'http://m.urbandictionary.com'
     }
     self.base_url = 'http://api.urbandictionary.com/v0'
예제 #5
0
파일: imdb.py 프로젝트: z/tautbot
 def __init__(self, command='imdb',
                    patterns=(
                        ('(.*:)//(imdb.com|www.imdb.com)(:[0-9]+)?(.*)$', 'imdb_url'),
                        ('.*tt\d+', 'imdb'),
                    )):
     super(self.__class__, self).__init__(command=command, patterns=patterns)
     Observer.__init__(self)
     self.headers = {'User-Agent': 'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19'}
     self.imdb_re = '(.*:)//(imdb.com|www.imdb.com)(:[0-9]+)?(.*)$'
     self.id_re = 'tt\d+'
예제 #6
0
 def __init__(self,
              command='google',
              aliases=(('google', 'google_search'), ('g', 'google_search'),
                       ('gis', 'google_image_search'))):
     super(self.__class__, self).__init__(command=command, aliases=aliases)
     Observer.__init__(self)
     self.headers = {
         'User-Agent':
         'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19'
     }
     self.base_url = 'http://dogpile.com/search'
예제 #7
0
    def __init__(self, command='flip', aliases=(('fix', 'fix'), )):
        super(self.__class__, self).__init__(command=command, aliases=aliases)
        Observer.__init__(self)
        self.table_status = defaultdict(lambda: None)
        self.use_flippers = True
        self.replacements = {
            'a': 'ɐ',
            'b': 'q',
            'c': 'ɔ',
            'd': 'p',
            'e': 'ǝ',
            'f': 'ɟ',
            'g': 'ƃ',
            'h': 'ɥ',
            'i': 'ᴉ',
            'j': 'ɾ',
            'k': 'ʞ',
            'l': 'ן',
            'm': 'ɯ',
            'n': 'u',
            'o': 'o',
            'p': 'd',
            'q': 'b',
            'r': 'ɹ',
            's': 's',
            't': 'ʇ',
            'u': 'n',
            'v': 'ʌ',
            'w': 'ʍ',
            'x': 'x',
            'y': 'ʎ',
            'z': 'z',
            '?': '¿',
            '.': '˙',
            ',': '\'',
            '(': ')',
            '<': '>',
            '[': ']',
            '{': '}',
            '\'': ',',
            '_': '‾'
        }

        # append an inverted form of replacements to itself, so flipping works both ways
        self.replacements.update(
            dict((v, k) for k, v in self.replacements.items()))

        self.flippers = ["( ノ⊙︵⊙)ノ", "(╯°□°)╯", "( ノ♉︵♉ )ノ"]
        self.table_flipper = "┻━┻ ︵ヽ(`Д´)ノ︵ ┻━┻"
예제 #8
0
 def __init__(self, command='dwi'):
     super(self.__class__, self).__init__(command=command)
     Observer.__init__(self)
     self.one_liner = None
     self.macros = [
         'https://i.imgur.com/WhgY2sX.gif',
         'https://i.imgur.com/eGInc.jpg',
         'https://i.imgur.com/KA3XSt5.gif',
         'https://i.imgur.com/rsuXB69.gif',
         'https://i.imgur.com/fFXmuSS.jpg',
         'https://j.gifs.com/L9mmYr.gif',
         'https://i.imgur.com/nxMBqb4.gif',
     ]
     self.phrases = [
         'Stop complaining, {}, and', 'Psssh {}, just',
         'Looks like {} needs to', 'Ever think that {} just needs to'
     ]
예제 #9
0
파일: trivia.py 프로젝트: z/tautbot
 def __init__(self,
              command='trivia',
              subcommands=(
                  ('question', 'get_trivia_question'),
                  ('answer', 'get_trivia_answer'),
                  ('top', 'db_top_scores'),
              ),
              aliases=(
                  ('question', 'get_trivia_question'),
                  ('answer', 'get_trivia_answer'),
                  ('top', 'db_top_scores'),
              )):
     super(self.__class__, self).__init__(command=command,
                                          aliases=aliases,
                                          subcommands=subcommands)
     Observer.__init__(self)
     self.base_url = "http://jservice.io/api"
     self.current = None
     self.question_cache = None
예제 #10
0
파일: calc.py 프로젝트: z/tautbot
 def __init__(self, command='calc'):
     super(self.__class__, self).__init__(command=command)
     Observer.__init__(self)
     self.aeval = Interpreter()
예제 #11
0
 def __init__(self, command='joke'):
     super(self.__class__, self).__init__(command=command)
     Observer.__init__(self)
     self.one_liner = None
     self.load_jokes()
예제 #12
0
 def __init__(self, command='ask'):
     super(self.__class__, self).__init__(command=command)
     Observer.__init__(self)
     self.cb = Cleverbot('cleverbot-tautbot')
예제 #13
0
파일: list.py 프로젝트: z/tautbot
 def __init__(self, command='list'):
     super(self.__class__, self).__init__(command=command)
     Observer.__init__(self)
예제 #14
0
파일: factoid.py 프로젝트: z/tautbot
 def __init__(self, command='factoid', aliases=(('info', 'info'), )):
     super(self.__class__, self).__init__(command=command, aliases=aliases)
     Observer.__init__(self)
     self.default_dict = {"who": "https://github.com/z"}
     self.factoid_cache = defaultdict(lambda: self.default_dict)
     self.load_cache()