コード例 #1
0
 async def send(self, app: Slave, yummy: [], group: Group, prefix: str):
     try:
         yande: PictureRipperListener.dataClass = yummy[0]
         img_byte: bytes = await yande.get()
         msg = [Image.fromUnsafeBytes(img_byte)]
         if self.ym == "ehentai" and hasattr(yande, 'gid'):
             msg.append(Plain(f'{yande.gid}/{yande.token}'))
         with enter_message_send_context(UploadMethods.Group):
             msg_chain = await MeCh.create(msg).build()
         image: Image = msg_chain.__root__[0]
         bot_message = await app.sendGroupMessage(
             group,
             msg_chain)  # At(sender.id), Plain(prefix_ + data_.purl),
         if len(self.GCache) >= 150:
             self.GCache.pop(list(self.GCache.keys())[0])
             logger.info('Cache is full,pop first one')
         ext = yande.url.split('.')[-1]
         self.GCache[(group.id << 32) + bot_message.messageId] = [
             image, ext, yande.id, yande.__class__.__name__
         ]
         logger.info(f"{prefix}sent,tags:{yande.tags}")
         await self.reCallYms(app, bot_message.messageId, 60)
     except asyncio.TimeoutError as e:
         logger.exception("[YummyPictures]: " + 'Timeout' + str(e))
         raise e
     except ValueError as e:
         logger.exception("[YummyPictures]: " + 'Size check failed' +
                          str(e))
         raise e
コード例 #2
0
 def __str__(self):
     logger.exception("This is not action in ripper")
コード例 #3
0
 def __str__(self):
     logger.exception("Error action" + self.action + "for parm" + self.parm)
コード例 #4
0
 def __str__(self):
     logger.exception("no period" + self.period + "in periods")
コード例 #5
0
 def __str__(self):
     logger.exception("Unknown action" + self.action)