コード例 #1
0
ファイル: bot.py プロジェクト: de-odex/Tachibot
 def __init__(self):
     super().__init__()
     self.manga_regex = re.compile(
         r"(?!`)<((?!https?:\/\/.*)(?!a?:.*:).*?)>(?!`)")
     self.anime_regex = re.compile(r"{((?!https?:\/\/.*)(?!a?:.*:).*?)}")
     self.tachi_id = 349436576037732353
     self.klient = kadal.Klient(loop=self.loop)
コード例 #2
0
 def __init__(self):
     super().__init__()
     # Note: this uses an OR regex hack.
     # Full match will match anything, but group 1 will match
     # the proper regex.
     self.regex = {
         "anime":
         re.compile(r"`[\s\S]*?`|{(.*?)}"),
         "manga":
         re.compile(r"<.*?https?:\/\/.*?>|<a?:.+?:\d*>|`[\s\S]*?`|<(.*?)>")
     }
     self.tachi_id = 349436576037732353
     self.klient = kadal.Klient(loop=self.loop)
     self.anilist_cover_url = "https://img.anili.st/media/"
コード例 #3
0
ファイル: bot.py プロジェクト: lleans/discordbot-saucefinder
    def __init__(self):
        super().__init__()
        # Command REGEX
        self.regex_command = {
            "image": re.compile(r'"(.*?)"'),
            "video": re.compile(r',(.*?),')
        }
        # Detect video using REGEX
        self.video = re.compile(
            r'(.*avi)|(.*m4v)|(.*mpeg)|(.*mpg)|(.*webm)|(.*mp4)')

        self.kadal = kadal.Klient()
        self.sauce = saucer.Sauce()
        print("start")