async def format_r34_images(r34posts: List[str]): """Formats the r34 posts into an embed""" for post in r34posts: embed = ColoredEmbed(title=f"Author's id : {post.creator_ID}", url=post.file_url) embed.set_image(url=post.file_url) fields = (('Created at', post.created_at), ('Resolution', f"{post.width} x {post.height}")) for name, value in fields: embed.add_field(name=name, value=value) yield embed
async def format_nhentai_pages(results: List[Doujinshi]): for doujin in results: embed = ColoredEmbed(title=f'{doujin.name} ({doujin.magic})', url=f'https://nhentai.net/g/{doujin.magic}') # Cover image if (cover_url:= getattr(doujin, 'cover', None)): embed.set_image(url=cover_url) # japanese name if (jname:= getattr(doujin, 'jname', None)): embed.add_field(name='Japanese name', value=jname, inline=False)