Esempio n. 1
0
 async def _spin(self, ctx, *, query=None):
     await ctx.cd()
     async with Loading(ctx):
         _image = await get_image(ctx, query)
         _buffer = await ctx.bot.loop.run_in_executor(
             None, image.spin, _image)
     await ctx.send(
         content=f"{core.CHECK} Image result for **{ctx.author.name}**",
         file=discord.File(_buffer, f"ShrimpMaster_spin.gif"))
Esempio n. 2
0
 async def _invert(self, ctx, *, query=None):
     await ctx.cd()
     async with Loading(ctx):
         _image = await get_image(ctx, query, png=False)
         _buffer, _format = await ctx.bot.loop.run_in_executor(
             None, image.invert, _image)
     await ctx.send(
         content=f"{core.CHECK} Image result for **{ctx.author.name}**",
         file=discord.File(_buffer, f"ShrimpMaster_invert.{_format}"))
Esempio n. 3
0
 async def _type(
     self, ctx, *,
     message: commands.clean_content(fix_channel_mentions=True)):
     await ctx.cd()
     async with Loading(ctx):
         _buffer = await ctx.bot.loop.run_in_executor(
             None, image.type_, message)
     await ctx.send(
         content=f"{core.CHECK} Image result for **{ctx.author.name}**",
         file=discord.File(_buffer, f"ShrimpMaster_type.gif"))
Esempio n. 4
0
 async def _seek(self, ctx, index: typing.Optional[int] = 1, *, query=None):
     if index <= 0:
         return await ctx.send("Index must be positive.")
     await ctx.cd()
     async with Loading(ctx):
         _image = await get_image(ctx, query, png=False)
         _buffer = await ctx.bot.loop.run_in_executor(
             None, image.seek, _image, index - 1)
         if not _buffer:
             return await ctx.send("Could not seek to that index.")
     await ctx.send(
         content=f"{core.CHECK} Image result for **{ctx.author.name}**",
         file=discord.File(_buffer, f"ShrimpMaster_frame{index}.png"))
Esempio n. 5
0
 async def _speed(self,
                  ctx,
                  factor: typing.Optional[typing.Union[int, float]] = 2,
                  *,
                  query=None):
     if factor > 24:
         return await ctx.send("Speed factor must be under 24.")
     if factor < 1 / 24:
         return await ctx.send("Speed factor must be over 1/24.")
     await ctx.cd()
     async with Loading(ctx):
         _image = await get_image(ctx, query, png=False)
         _buffer = await ctx.bot.loop.run_in_executor(
             None, image.speed, _image, factor)
     await ctx.send(
         content=f"{core.CHECK} Image result for **{ctx.author.name}**",
         file=discord.File(_buffer, f"ShrimpMaster_speed.gif"))
Esempio n. 6
0
 async def _posterize(self,
                      ctx,
                      intensity: typing.Optional[int] = 2,
                      *,
                      query=None):
     if intensity > 10:
         return await ctx.send("Intensity must be under 10.")
     if intensity <= 0:
         return await ctx.send("Intensity must be positive.")
     await ctx.cd()
     async with Loading(ctx):
         _image = await get_image(ctx, query)
         _buffer, _ = await ctx.bot.loop.run_in_executor(
             None, image.posterize, _image, intensity)
     await ctx.send(
         content=f"{core.CHECK} Image result for **{ctx.author.name}**",
         file=discord.File(_buffer, f"ShrimpMaster_posterize.png"))
Esempio n. 7
0
    async def _petpet(self,
                      ctx,
                      intensity: typing.Optional[typing.Union[int, float]] = 0,
                      *,
                      query=None):
        if intensity > 10:
            return await ctx.send("Intensity should be under 10.")
        if intensity < 0:
            return await ctx.send("Intensity should not be negative.")

        await ctx.cd()

        async with Loading(ctx):
            _image = await get_image(ctx, query)
            _buffer = await ctx.bot.loop.run_in_executor(
                None, image.petpet, _image, intensity / 5)
        await ctx.send(
            content=f"{core.CHECK} Image result for **{ctx.author.name}**",
            file=discord.File(_buffer, f"ShrimpMaster_petpet.gif"))
Esempio n. 8
0
    async def _magik(self,
                     ctx,
                     intensity: typing.Optional[typing.Union[int, float]] = 2,
                     *,
                     query=None):
        if intensity > 100:
            return await ctx.send("Intensity should be under 100.")
        if intensity <= 0:
            return await ctx.send("Intensity should be positive.")

        await ctx.cd()

        async with Loading(ctx):
            _image = await get_image(ctx, query)
            _buffer, _mode = await ctx.bot.loop.run_in_executor(
                None, image.magik, _image, intensity)
        await ctx.send(
            content=f"{core.CHECK} Image result for **{ctx.author.name}**",
            file=discord.File(_buffer, f"ShrimpMaster_magik.{_mode}"))
Esempio n. 9
0
 async def _use_clover(self, ctx, _):
     async with Loading(ctx, "Using your clover..."):
         await asyncio.sleep(random(1.5, 3.))
     await ctx.send("idiot")