async def hanime(self, ctx: Context, *, query: str = ''): """Searches hanime for hentai""" if query == '': return await self.hanimerandom.invoke(ctx) data = await self.hanime_search(query) if len(data) == 0: await ctx.send(f"No hentai found for query `{query}`") return embeds = [ discord.Embed( colour=Colour.gold(), title=hentai['name'], description=re.sub(r'<.+?>', '', hentai['description']) ).set_author( name=f"Result for search {query}", url="https://hanime.tv/videos/hentai/"+hentai['slug'] ).set_image( url=hentai['cover_url'] ).add_field( name="tags", value=", ".join(hentai['tags']) ).set_footer( text=f"{hentai['views']} views | " f"{hentai['likes']} likes & {hentai['dislikes']} dislikes" ) for hentai in data ] menu = DefaultMenu() await menu.send_pages(ctx, ctx, embeds)
class EventColors(Enum): ban = Colour.dark_red() unban = Colour.teal() kick = Colour.red() join = Colour.dark_green() leave = Colour.blue() delete = Colour.magenta() bulk_delete = Colour.dark_magenta() edit = Colour.gold() name_change = Colour.purple() nickname_change = Colour.blurple() role_added = Colour.dark_teal() role_removed = Colour.orange() verified = Colour.light_grey()
async def hanimerandom(self, ctx: Context): data = await self.hanime_random() embeds = [ discord.Embed( colour=Colour.gold(), description=f"{hentai['views']} views\n" f"{hentai['likes']} likes & {hentai['dislikes']} dislikes" ).set_author( name=hentai['name'], url="https://hanime.tv/videos/hentai/"+hentai['slug'] ).set_image( url=hentai['cover_url'] ).set_footer( text=f"page: {i}/{len(data)}" ) for i,hentai in enumerate(data, 1) ] menu = DefaultMenu() await menu.send_pages(ctx, ctx, embeds)