Пример #1
0
    async def random(self, ctx):
        async with ctx.typing():
            doujin = Utils.get_random_hentai()
            embed, components = self.helpers.generate_list_hentai_embed(
                doujin, 1, 1, disable_components=True)

            await ctx.send(embed=embed, components=components)
Пример #2
0
    async def random(self, ctx: Context) -> None:

        """
        Get a random hentai from NHentai.
        """

        hnt = Utils.get_random_hentai()
        embed = self.make_embed(hnt)
        await ctx.send(embed=embed)
Пример #3
0
async def nh(menu):
    id = menu.extraProcVars['id']
    ctx = menu.extraProcVars['ctx']
    # No ID? Send random
    if id is None:
        await ctx.send('No ID passed, getting random doujin...')
        d = Utils.get_random_hentai()
    # ID not digits
    elif not id.isdigit():
        await ctx.send(
            'Invalid ID\nIDs are usually 6 digit numbers, although there are some 5 digin and even shorter or longer IDs\nIf you don\'t have an ID just don\'t write one and we will send you a random doujin or use the nhs command to search or nhh command to view the current home page'
        )
    # Does Doujin exist?
    elif Hentai.exists(id):
        d = Hentai(id)
    else:
        await ctx.send(
            f'No Doujin with id: {id} was found\n\nIf you don\'t have an ID just don\'t write one and we will send you a random doujin or use the nhs command to search or nhh command to view the current home page'
        )

    return d
Пример #4
0
 def test_random_hentai(self):
     random_hentai = Utils.get_random_hentai()
     response = requests.get(random_hentai.url)
     self.assertTrue(
         response.ok,
         msg=f"Failing ID: {random_hentai.id}. Failing URL: {response.url}")
Пример #5
0
 async def nh_random(self, ctx):
     """Ger a random manga from NHentai"""
     hnt = Utils.get_random_hentai()
     embed = self.make_embed(hnt)
     await ctx.send(embed=embed)
Пример #6
0
 def test_random_hentai(self):
     print("Setting make_request flag to 'False'")
     random_hentai = Utils.get_random_hentai(make_request=False)
     response = requests.get(random_hentai.url)
     self.assertTrue(response.ok, msg=f"Failing ID: {random_hentai.id}. Failing URL: {response.url}")