def songembed(song, queued: bool = False): e = Embed(title = song.title if not queued else f'Queued - {song.title}', url=song.url) e.set_image(url=song.thumbnail) e.description=f"- {song.channel} : {song.channel_url}" e.timestamp=discord.utils.utcnow() e.set_footer(text=f'Views: {song.views} | Duration: {round(song.duration/60)} minutes',icon_url=song.thumbnail) return e
async def slap(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Slap someone""" member = member or ctx.author if member in ["@everyone", "@here"]: await ctx.send( f"** {ctx.author.mention} why would you slap @everyone? **", allowed_mentions=discord.AllowedMentions(everyone=False), ) return else: desc = f"** {ctx.author.mention} slaps {member.mention} !!! Damm! **" if member == ctx.author: desc = f"** {ctx.author.mention} slaps themselves !!! LOL! **" url = member.display_avatar.url img = await self.dagpi.image_process( ImageFeatures.slap(), url2=ctx.author.display_avatar.url, url=url, ) e2file = discord.File(fp=img.image, filename=f"slap.{img.format}") e = Embed(description=desc) e.set_image(url=f"attachment://slap.{img.format}") await ctx.send(embed=e, file=e2file)
async def callback(self, response: discord.SlashCommandResponse): if not response.interaction.guild.icon: return await response.send_message( "This server does not have a avatar...", ephemeral=True) e = Embed( title=f":information_source: Icon for {response.interaction.guild}" ) e.set_image(url=response.interaction.guild.icon.with_format("png").url) await response.send_message(embed=e)
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 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 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 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 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 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 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 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 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 callback(self, interaction: discord.Interaction): if self.view is None: raise AssertionError value = self.values[0] self.view.character = self.view.get_character_config(value) await interaction.response.defer() embed = Embed(title=self.view.character.name.title()) embed.set_image(url=random.choice(self.view.character.images)) embed.set_author(name=self.view.player.display_name, icon_url=self.view.player.display_avatar.url) await interaction.message.edit(embed=embed, view=self.view)
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 high5(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Do a highfive""" member = member or ctx.author if member in ["@everyone", "@here"]: desc = f"**@everyone , {ctx.author.mention} high-fives **" else: desc = f"**{ctx.author.mention} high fives {member.mention} !!! **" if member == ctx.author: desc = f"**{ctx.author.mention} high-fives **" embed = Embed(description=desc, timestamp=discord.utils.utcnow()) embed.set_image(url=await ctx.tenor("anime highfive")) await ctx.send(embed=embed)
async def message(self, ctx, member: Optional[Union[discord.Member, MemberID]], *, text): """Send a fake Discord message""" member = member or ctx.author uname = member.display_name text = str(text) pfp = str(member.display_avatar.url) img = await self.dagpi.image_process(ImageFeatures.discord(), url=pfp, username=uname, text=text) e2file = discord.File(fp=img.image, filename=f"message.{img.format}") e = Embed(title="Here You Go! Message Sent!") e.set_image(url=f"attachment://message.{img.format}") await ctx.send(file=e2file, embed=e)
async def spank(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Spank someone""" member = member or ctx.author if member in ["@everyone", "@here"]: await ctx.send( f"** {ctx.author.mention} why would you spank @everyone? **", allowed_mentions=discord.AllowedMentions(everyone=False), ) return else: desc = f"** {ctx.author.mention} spanks {member.mention} !!! Damm! **" if member == ctx.author: desc = f"** {ctx.author.mention} spanks themselves !!! LOL! **" embed = Embed(description=desc, timestamp=discord.utils.utcnow()) embed.set_image(url=await ctx.tenor("anime spank")) await ctx.send(embed=embed)
async def wni(self, ctx, *, member: Optional[Union[discord.Member, MemberID]]): """Prove that you are not sus!""" if member == "@everyone": await ctx.send( f"** {ctx.author.mention} yes yes!!! Everyone is not sus!**") return member = member or ctx.author desc = f"** {member.mention} was not the imposter**" file = discord.File( fp=among_us, filename='wni.png', description=f"** {member.display_name} was not the imposter**") embed = Embed(description=desc, timestamp=discord.utils.utcnow()) embed.set_image(url="attachment://wni.png") await ctx.send(file=file, embed=embed)
async def party(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Party with someone""" member = member or ctx.author if member in ["@everyone", "@here"]: desc = ( f"**@everyone {ctx.author.mention} is partying!! come join them !! **" ) else: desc = ( f"**{ctx.author.mention} parties with {member.mention} !!! Yaay !!! **" ) if member == ctx.author: desc = f"**{ctx.author.mention} is partying !!!**" embed = Embed(description=desc, timestamp=discord.utils.utcnow()) embed.set_image(url=await ctx.tenor("anime party")) await ctx.send(embed=embed)
async def hug(self, ctx, member: Optional[Union[discord.Member, MemberID]]): """Hug someone""" member = member or ctx.author if member in ["@everyone", "@here"]: await ctx.send( f"** {ctx.author.mention} why would you hug @everyone? **", allowed_mentions=discord.AllowedMentions(everyone=False), ) return else: desc = f"** {ctx.author.mention} hugs {member.mention} !!! :heart: :heart: :heart: **" if member == ctx.author: desc = f"** {ctx.author.mention} hugs themselves !!! :heart: :heart: :heart: :heart: **" embed = Embed(description=desc, timestamp=discord.utils.utcnow()) embed.set_image(url=await ctx.get_random_image_from_tag("anime hugs")) await ctx.send(embed=embed)
async def ping(self, ctx): """Get the Latency""" import time starttime = time.time() msg = await ctx.send(":ping_pong: Ping... :ping_pong:") async with ctx.channel.typing(): e = Embed( title=":ping_pong: Pong! :ping_pong:", description= f"Heartbeat : {round(self.bot.latency * 1000, 2)} ms", ) endtime = time.time() difference = float(int(starttime - endtime)) e.add_field(name=":inbox_tray: Script Speed :outbox_tray:", value=f"{difference}ms") e.set_image(url=await self.bot.get_random_image_from_tag( "ping pong anime")) await msg.edit(content="", embed=e)
async def get_waifu(self) -> Tuple[Embed, str]: """Returns a random waifu from the api :return: tuple of (Embed, name) :rtype: Tuple[Embed, str] """ waifu = await self.bot.dagpi.waifu() pic = waifu["display_picture"] name = waifu["name"] likes_rank = waifu["like_rank"] trash_rank = waifu["trash_rank"] anime = waifu["appearances"][0]["name"] url = waifu["url"] e = Embed(title=name) e.add_field(name="**Anime**", value=anime, inline=True) e.add_field(name="**:heartbeat:**", value=likes_rank, inline=True) e.add_field(name="**:wastebasket:**", value=trash_rank, inline=True) e.add_field(name="**:link:**", value=f"[Know More]({url})") e.set_image(url=pic) e.set_footer(text="React with any emoji in 30 sec to claim him/her") return e, name
async def mangasearch(self, ctx: commands.Context, *, manga_name: str): """Searches Manga from MAL and displays the first 10 search result.""" search = MangaSearch(str(manga_name).strip(" ").lower()) search_results = search.results[:10] description = "" for i, k in enumerate(search_results): description += f"{i+1}. **{k.title}**\n" e1 = Embed( title=f"Manga search results for {str(manga_name).capitalize()}", description=description, timestamp=ctx.message.created_at, ) e1.set_footer( text= f"Showing 10 results out of {len(search.results)} | Use the recations of this message to paginate", icon_url= "https://cdn.myanimelist.net/images/event/15th_anniversary/top_page/item7.png", ) embeds = [e1] for i in search_results: e = Embed(title=i.title, description=i.synopsis, timestamp=ctx.message.created_at) if i.score: e.add_field(name="**Score**", value=f"{i.score} :star:") if i.type: e.add_field(name="**Manga Type**", value=i.type) if i.url: e.add_field(name="**MAL Url**", value=f"[CLICK HERE]({i.url})") if i.mal_id: e.add_field(name="**MAL ID**", value=i.mal_id) if i.image_url: e.set_image(url=i.image_url) e.set_footer(text=f"{i.title} | {i.mal_id} | {i.score} stars", icon_url=i.image_url) embeds.append(e) paginator = EmbedPaginator(entries=embeds, ctx=ctx) await paginator.start()
async def captcha( self, ctx, member: Optional[Union[discord.Member, MemberID]], *, text="Detect Face", ): """Captcha v3 Image mockup""" member = member or ctx.author text = str(text) textaslen = len(text) if textaslen > 13: await ctx.send("Maybe text length something smaller then 13?") else: pfp = member.display_avatar.url img = await self.dagpi.image_process(ImageFeatures.captcha(), url=pfp, text=text) e2file = discord.File(fp=img.image, filename=f"captcha.{img.format}") e = Embed(title="Here You Go! Another Captcha?") e.set_image(url=f"attachment://captcha.{img.format}") await ctx.send(file=e2file, embed=e)
def make_embed( self, character: Optional[Characters] = None, author: Optional[discord.Member] = None, color: Optional[discord.Color] = None, ) -> Embed: character = character or (self.character1 if self.turn == self.player1 else self.character2) author = author or (self.player1 if character == self.character1 else self.player2) embed = Embed() embed.title = character.name embed.set_image(url=random.choice(character.images)) embed.set_footer( text= f'{self.special_moves1 if character == self.character1 else self.special_moves2} special moves left | {self.heal_moves1 if character == self.character1 else self.heal_moves2} heal operations left' ) embed.description = self.percentage_and_progess_bar( self.health1 if character == self.character1 else self.health2) embed.set_author(name=author.display_name, icon_url=author.display_avatar.url) if color is not None: embed.color = color return embed
async def whosthatpokemon(self, ctx: commands.Context): """Play Who\'s That Pokemon?""" async with ctx.typing(): wtp = await self.bot.dagpi.wtp() question = wtp.question answer = wtp.name.lower() e = Embed(title="Who's That Pokemon?", timestamp=ctx.message.created_at) e.set_footer( text=f"{ctx.message.author} reply within 30secs to answer.", icon_url=ctx.message.author.avatar.url, ) e.set_image(url=question) question_message = await ctx.send( "You have 3 chances, **Chance: 1/3**", embed=e) answerembed = discord.Embed( title=f"The Pokemon is: {wtp.name.capitalize()}", description= f"```Here is the Info\n\nAbilities: {', '.join(list(map(lambda x: x.capitalize(),wtp.abilities)))}```", timestamp=ctx.message.created_at, ) answerembed.add_field(name="**Height**", value=f"{round(wtp.height)}m") answerembed.add_field(name="**Weight**", value=f"{round(wtp.weight)} kg") answerembed.add_field(name=":id:", value=wtp.id) answerembed.set_image(url=wtp.answer) answerembed.set_footer(text=wtp.name.capitalize(), icon_url=wtp.answer) answerembed.set_author(name=wtp.name.capitalize(), url=wtp.link, icon_url=wtp.answer) for i in range(3): try: answer_content = await self.bot.wait_for( "message", timeout=30, check=lambda m: m.author == ctx.author and m.channel == ctx .channel, ) except asyncio.TimeoutError: try: await answer_content.delete() except (discord.NotFound, discord.Forbidden, discord.HTTPException): pass await ctx.send(embed=ErrorEmbed( description= "Well you didn't atleast once.\n Thus I won't be telling you the answer! :rofl:. **Baka**" )) return await asyncio.sleep(0.8) if answer_content.content.lower() != answer: try: await answer_content.delete() except (discord.NotFound, discord.Forbidden, discord.HTTPException): pass await ctx.send( embed=ErrorEmbed( description="Please try again! :no_entry:"), delete_after=3, ) await question_message.edit( content=f"You have {3-(i+1)} chances, **Chance: {i+1}/3**", embed=e, ) pass elif answer_content.content.lower() == answer: try: await answer_content.delete() except (discord.NotFound, discord.Forbidden, discord.HTTPException): pass answerembed.color = discord.Color.green() await question_message.edit( content= f"**Yes you guessed it right!** in {i+1} chance(s), {ctx.author.mention}", embed=answerembed, ) return elif i + 1 == 3 and answer_content.content.lower() != answer: try: await answer_content.delete() except (discord.NotFound, discord.Forbidden, discord.HTTPException): pass answerembed.color = discord.Color.red() await question_message.edit( content= f"Well you couldn't **guess it right in 3 chances**. Here is your **answer**!, {ctx.author.mention}", embed=answerembed, ) return try: await answer_content.delete() except (discord.NotFound, discord.Forbidden, discord.HTTPException): pass answerembed.color = discord.Color.red() await question_message.edit( content= f"Well you couldn't **guess it right in 3 chances**. Here is your **answer**!, {ctx.author.mention}", embed=answerembed, )