Esempio n. 1
0
 def make_msg(self, details, content, imgs, sid, username):
     warning(f"send msg {sid} img: {len(imgs) if imgs else 0}")
     msg = f"{details.uptime}\n🔥{details.title}\n\nAuthor: {username}\nPrice: ${details.priceUSDT}\nSource: {details.detailurl}\n\n\n>>> {content}\n"
     msg = msg if len(msg) < 1000 else msg[:997] + "..."
     if (moment.date(details.uptime) > moment.now().replace(
             hours=0, minutes=0,
             seconds=0).add(days=self.notice_range)) or Config.sendForTest:
         if not imgs:
             telegram(msg, sid, Config.darknetchannelID)
         else:
             telegram_with_pic(imgs, msg, sid, Config.darknetchannelID)
Esempio n. 2
0
    def __make_msg(self, details, content, imgs, sid, username):

        msg = f"{details.uptime}\n🔥{details.title}\n\nAuthor: {username}\nPrice: ${details.priceUSDT}\nSource: {details.detailurl}\n\n\n${content}\n"
        msg = msg if len(msg) < 1000 else msg[:997] + "..."
        if (details.area in Config.filterArea and moment.date(details.uptime) >
                moment.now().replace(hours=0, minutes=0, seconds=0).add(
                    days=self.__notice_range)) or Config.sendForTest:
            if not imgs:
                # telegram.delay(msg, sid, Config.darknetchannelID)
                telegram(msg, sid, Config.darknetchannelID)
            else:
                telegram_withpic(imgs[0], msg, sid, Config.darknetchannelID)