async def magic(self, ctx, user: discord.Member = None): """See magic!""" user = user or ctx.author url = str(user.avatar.with_format("png").with_size(1024).url) img = await self.bot.dagpi.image_process(ImageFeatures.magik(), url) e2file = discord.File(fp=img.image, filename=f"magik.{img.format}") e = Embed(title="Magik!") e.set_image(url=f"attachment://magik.{img.format}") await ctx.send(embed=e, file=e2file)
async def dag_captcha(self, ctx: Context, text, *, item: GetAvatar): """ Overlays your image on a captcha grid. """ async with ctx.channel.typing(): image = await self.bot.dagpi.image_process(ImageFeatures.captcha(), item, text=text) await self.dag_embed(ctx, image, ctx.command.name)
async def rainbow(self, ctx, member: discord.Member = None): if member is None: member = ctx.author url = str(member.avatar_url_as(format="png", size=1024)) img = await self.bot.dagpi.image_process(ImageFeatures.gay(), url) e2file = discord.File(fp=img.image, filename=f"rainbow.{img.format}") e = discord.Embed(title="Here You Go! Filter used is gay!") e.set_image(url=f"attachment://rainbow.{img.format}") await ctx.send(embed=e, file=e2file)
async def jail(self, ctx, member: discord.Member = None): """Yes.""" if member is None: member = ctx.author url = str(member.avatar_url_as(format="png", size=1024)) img = await self.bot.dagpi.image_process(ImageFeatures.jail(), url=url) e2file = discord.File(fp=img.image, filename=f"jail.{img.format}") e = discord.Embed(title="Here You Go! Filter used is jail!") e.set_image(url=f"attachment://jail.{img.format}") await ctx.send(file=e2file, embed=e)
async def shatter(self, ctx): url = str( ctx.message.author.avatar_url_as(format="png", static_format="png", size=1024)) img = await self.bot.dagp.image_process(ImageFeatures.thought_image(), url, text='HOLA') await ctx.send( file=discord.File(fp=img.image, filename=f"shatter.{img.format}"))
async def satan(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Be the Devil""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.satan(), url) e2file = discord.File(fp=img.image, filename=f"satan.{img.format}") e = Embed(title="Satan!!!") e.set_image(url=f"attachment://satan.{img.format}") await ctx.send(embed=e, file=e2file)
async def angel(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Be an Angel""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.angel(), url) e2file = discord.File(fp=img.image, filename=f"angel.{img.format}") e = Embed(title="Our dear Angel!") e.set_image(url=f"attachment://angel.{img.format}") await ctx.send(embed=e, file=e2file)
async def jail(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Jail yourself or someone""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.jail(), url=url) e2file = discord.File(fp=img.image, filename=f"jail.{img.format}") e = Embed(title="Here You Go! Filter used is jail!") e.set_image(url=f"attachment://jail.{img.format}") await ctx.send(file=e2file, embed=e)
async def triggered(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Make anyone triggered""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.triggered(), url) e2file = discord.File(fp=img.image, filename=f"triggered.{img.format}") e = Embed(title="Here You Go! Filter used is triggered!") e.set_image(url=f"attachment://triggered.{img.format}") await ctx.send(file=e2file, embed=e)
async def wanted(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Get yourself or someone listed in Bingo Book""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.wanted(), url) e2file = discord.File(fp=img.image, filename=f"wanted.{img.format}") e = Embed(title="Here You Go! Filter used is wanted!") e.set_image(url=f"attachment://wanted.{img.format}") await ctx.send(file=e2file, embed=e)
async def bomb(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Bomb someone""" e = Embed(title="Boooom! :skull_crossbones:") member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.bomb(), url) e2file = discord.File(fp=img.image, filename=f"bomb.{img.format}") e.set_image(url=f"attachment://bomb.{img.format}") await ctx.send(embed=e, file=e2file)
async def wasted(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """GTA V wasted screen""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.wasted(), url) e2file = discord.File(fp=img.image, filename=f"wasted.{img.format}") e = Embed(title="Wasted! :skull_crossbones:") e.set_image(url=f"attachment://wasted.{img.format}") await ctx.send(embed=e, file=e2file)
async def hitler(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Hail Hitler""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.hitler(), url) e2file = discord.File(fp=img.image, filename=f"hitler.{img.format}") e = Embed(title="Worse than Hitler!!!") e.set_image(url=f"attachment://hitler.{img.format}") await ctx.send(embed=e, file=e2file)
async def charcoal(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Get your pfp beautiful charcoal paint""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.charcoal(), url) e2file = discord.File(fp=img.image, filename=f"charcoal.{img.format}") e = Embed(title="There you go your lovely charcoal paintaing") e.set_image(url=f"attachment://charcoal.{img.format}") await ctx.send(embed=e, file=e2file)
async def pixel( self, ctx, thing: typing.Union[discord.Member, discord.PartialEmoji, discord.Emoji, str] = None, ): async with ctx.channel.typing(): url = await self.get_url(ctx, thing) img = await dagpi.image_process(ImageFeatures.pixel(), url) file = discord.File(fp=img.image, filename=f"pixel.{img.format}") await ctx.send(file=file)
async def delete(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Removes trash from bin""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.delete(), url) e2file = discord.File(fp=img.image, filename=f"delete.{img.format}") e = Embed(title="There you go piece of trash removed!") e.set_image(url=f"attachment://delete.{img.format}") await ctx.send(embed=e, file=e2file)
async def trash(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Puts trash into trashbin""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.trash(), url) e2file = discord.File(fp=img.image, filename=f"trash.{img.format}") e = Embed(title="There you go piece of Trash!") e.set_image(url=f"attachment://trash.{img.format}") await ctx.send(embed=e, file=e2file)
async def gay(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Seperate yourself/others and mark them/yourself as gay!""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.gay(), url) e2file = discord.File(fp=img.image, filename=f"gay.{img.format}") e = Embed(title="There you go gay!") e.set_image(url=f"attachment://gay.{img.format}") await ctx.send(embed=e, file=e2file)
async def rainbow(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Rainbow light effect""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.gay(), url) e2file = discord.File(fp=img.image, filename=f"rainbow.{img.format}") e = Embed(title="Here You Go! Filter used is gay!") e.set_image(url=f"attachment://rainbow.{img.format}") await ctx.send(embed=e, file=e2file)
async def pat(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Pat someone, UwU!""" member = member or ctx.author url = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.petpet(), url) e2file = discord.File(fp=img.image, filename=f"petpet.{img.format}") e = Embed(title="UwU Pat!") e.set_image(url=f"attachment://petpet.{img.format}") await ctx.send(file=e2file, embed=e)
async def dag_tweet(self, ctx, user: GetAvatar, username: str, *, text: str): """ Makes it look like you or someone else tweeted something. """ async with ctx.channel.typing(): image = await self.bot.dagpi.image_process(ImageFeatures.tweet(), text=text, url=user, username=username) await self.dag_embed(ctx, image, ctx.command.name)
async def jail(self, ctx, author: discord.Member = None): await ctx.trigger_typing() author1 = author if author1 is None: author1 = ctx.author url = str( author1.avatar_url_as(format="png", static_format="png", size=1024)) img = await self.bot.dagp.image_process(ImageFeatures.jail(), url) file = discord.File(fp=img.image, filename=f"pixel.{img.format}") await ctx.reply(file=file)
async def comment(self, ctx, user: BetterMemberConverter = None, *, text): if user is None: user = ctx.author uname = user.display_name text = str(text) pfp = str(user.avatar_url_as(format="png", size=1024)) img = await self.client.dagpi.image_process(ImageFeatures.youtube(), url=pfp, username=uname, text=text) await self.to_embed(ctx, img, "comment")
async def test_image(): tok = os.getenv("DAGPI_TOKEN") c = Client(tok) img = await c.image_process(ImageFeatures.pixel(), "https://dagbot-is.the-be.st/logo.png") await c.close() img.write("some.png") assert isinstance(img, Image) assert isinstance(img.read(), bytes) assert isinstance(repr(img), str) assert isinstance(img.size(), int)
async def whyrugay(self, ctx, member: discord.Member = None): await ctx.trigger_typing() if member is None: member = ctx.author url = str( member.avatar_url_as(format="png", static_format="png", size=1024)) img = await self.bot.dagp.image_process( ImageFeatures.why_are_you_gay(), str(ctx.message.author.avatar_url), url2=url) await ctx.send( file=discord.File(fp=img.image, filename=f"pixel.{img.format}"))
async def captcha(self, ctx, user: BetterMemberConverter = None, *, text: str): if user is None: user = ctx.author pfp = str(user.avatar_url_as(format="png", size=1024)) img = await self.client.dagpi.image_process(ImageFeatures.captcha(), url=pfp, text=text) await self.to_embed(ctx, img, "captcha")
async def triangle( self, ctx, thing: typing.Union[discord.Member, discord.PartialEmoji, discord.Emoji, str] = None, ): async with ctx.channel.typing(): url = await self.get_url(ctx, thing) url = url.replace("cdn.discordapp.com", "media.discordapp.net") img = await dagpi.image_process(ImageFeatures.triangle(), url) file = discord.File(fp=img.image, filename=f"pixel.{img.format}") await ctx.send(file=file)
async def polaroid(self, ctx: utils.CustomContext, user: discord.Member = None): """Puts someones profile picture in a polaroid. Powered by Dagpi.""" async with ctx.timeit: async with ctx.typing(): user = user or ctx.author img_file = await do_dagpi_stuff(ctx, user, ImageFeatures.polaroid()) await ctx.send("*Look at this photograph*", file=img_file)
async def pixelate(self, ctx: utils.CustomContext, user: discord.Member = None): """Pixelates someones profile picture. Powered by Dagpi.""" async with ctx.timeit: async with ctx.typing(): user = user or ctx.author img_file = await do_dagpi_stuff(ctx, user, ImageFeatures.pixel()) await ctx.send(file=img_file)
async def colours(self, ctx: utils.CustomContext, user: discord.Member = None): """Gives you the top 5 colours of your own or another persons profile picture. Powered by Dagpi.""" async with ctx.timeit: async with ctx.typing(): user = user or ctx.author img_file = await do_dagpi_stuff(ctx, user, ImageFeatures.colors()) await ctx.send(f"Top 5 Colours for {user}", file=img_file)