Ejemplo n.º 1
0
    async def pat2(self, ctx, *, Member: BetterMemberConverter = None):
        Member = Member or ctx.author

        if Member.id == ctx.author.id:
            person = self.client.user
            target = ctx.author

        if Member.id != ctx.author.id:
            person = ctx.author
            target = Member

        asuna = asuna_api.Client(session=self.client.session)
        url = await asuna.get_gif("pat")

        embed = discord.Embed(color=random.randint(0, 16777215))
        embed.set_author(name=f"{person} patted you! *pat pat pat*",
                         icon_url=(person.avatar_url))
        embed.set_image(url=url.url)
        embed.set_footer(text="powered using the asuna.ga api")

        if isinstance(ctx.channel, discord.TextChannel):
            await ctx.send(content=target.mention, embed=embed)

        if isinstance(ctx.channel, discord.DMChannel):
            if target.dm_channel is None:
                await target.create_dm()

            try:
                await target.send(content=target.mention, embed=embed)
            except discord.Forbidden:
                await ctx.author.send("Failed DM'ing them...")
Ejemplo n.º 2
0
 async def random_history(self, ctx, *, args=None):
     if args is None:
         args = 1
     asuna = asuna_api.Client(self.client.session)
     response = await asuna.random_history(args)
     for x in response:
         await ctx.send(f":earth_africa: {x}")
Ejemplo n.º 3
0
    async def mchistory(self, ctx, *, args=None):

        if args is None:
            await ctx.send("Please pick a minecraft user.")

        if args:
            asuna = asuna_api.Client(self.client.session)
            minecraft_info = await asuna.mc_user(args)
            embed = discord.Embed(title=f"Minecraft Username: {args}",
                                  color=random.randint(0, 16777215))
            embed.set_footer(text=f"Minecraft UUID: {minecraft_info.uuid}")
            embed.add_field(name="Orginal Name:", value=minecraft_info.name)
            y = 0
            for x in minecraft_info.history:
                if y > 0:
                    embed.add_field(
                        name=f"Username:\n{x['name']}",
                        value=
                        f"Date Changed:\n{x['changedToAt']}\n \nTime Changed: \n {x['timeChangedAt']}",
                    )

                y = y + 1
            embed.set_author(name=f"Requested by {ctx.author}",
                             icon_url=(ctx.author.avatar_url))
            await ctx.send(embed=embed)
Ejemplo n.º 4
0
 async def fox2(self, ctx):
     asuna = asuna_api.Client(session=self.client.session)
     url = await asuna.get_gif("wholesome_foxes")
     embed = discord.Embed(color=random.randint(0, 16777215))
     embed.set_author(
         name=f"{ctx.author} requested a wholesome fox picture",
         icon_url=(ctx.author.avatar_url),
     )
     embed.set_image(url=url.url)
     embed.set_footer(text="powered using the asuna.ga api")
     await ctx.send(embed=embed)