modules/informational.py
async def twitch(self, ctx, account):
        """Returns information on the Twitch account you want information on."""
        try:
            async with aiohttp.ClientSession() as cs:
                async with cs.get(f"https://api.twitch.tv/kraken/channels/{account}?client_id={twitch_clientID}") as r:
                    res = await r.json()
                    creationdate = datetime.strptime(str(res['created_at']).split('.')[0], "%Y-%m-%dT%H:%M:%SZ").strftime("%m-%d-%Y")

                    embed = discord.Embed(colour=3553599)
                    embed.set_author(name=res["display_name"], icon_url="https://i.imgur.com/OQwQ8z0.jpg", url=res["url"])
                    embed.add_field(
                        name="Account ID",
                        value=res["_id"],
                        inline=True
                    )
                    embed.add_field(
                        name="\u200B",
                        value="\u200B",
                        inline=True
                    )
                    embed.add_field(
                        name="Followers",
                        value=res["followers"],
                        inline=True
                    )
                    embed.add_field(
                        name="Created On",
                        value=creationdate,
                        inline=True
                    )
                    embed.add_field(
                        name="\u200B",
                        value="\u200B",
                        inline=True
                    )
                    embed.add_field(
                        name="Channel Views",
                        value=res["views"],
                        inline=True
                    )

                    await ctx.send(embed=embed)
        except Exception:
            await ctx.send(f"Unable to find account: {account}. Are you sure you spelt it correctly?")
Returns information on the Twitch account you want information on.
Returns information on the Twitch account you want information on.
Returns information on the Twitch account you want information on .
async def twitch(self, ctx, account):
        try:
            async with aiohttp.ClientSession() as cs:
                async with cs.get(f"https://api.twitch.tv/kraken/channels/{account}?client_id={twitch_clientID}") as r:
                    res = await r.json()
                    creationdate = datetime.strptime(str(res['created_at']).split('.')[0], "%Y-%m-%dT%H:%M:%SZ").strftime("%m-%d-%Y")
                    embed = discord.Embed(colour=3553599)
                    embed.set_author(name=res["display_name"], icon_url="https://i.imgur.com/OQwQ8z0.jpg", url=res["url"])
                    embed.add_field(
                        name="Account ID",
                        value=res["_id"],
                        inline=True
                    )
                    embed.add_field(
                        name="\u200B",
                        value="\u200B",
                        inline=True
                    )
                    embed.add_field(
                        name="Followers",
                        value=res["followers"],
                        inline=True
                    )
                    embed.add_field(
                        name="Created On",
                        value=creationdate,
                        inline=True
                    )
                    embed.add_field(
                        name="\u200B",
                        value="\u200B",
                        inline=True
                    )
                    embed.add_field(
                        name="Channel Views",
                        value=res["views"],
                        inline=True
                    )
                    await ctx.send(embed=embed)
        except Exception:
            await ctx.send(f"Unable to find account: {account}. Are you sure you spelt it correctly?")
async def twitch ( self , ctx , account ) : try : async with aiohttp . ClientSession ( ) as cs : async with cs . get ( f"https://api.twitch.tv/kraken/channels/{account}?client_id={twitch_clientID}" ) as r : res = await r . json ( ) creationdate = datetime . strptime ( str ( res [ 'created_at' ] ) . split ( '.' ) [ 0 ] , "%Y-%m-%dT%H:%M:%SZ" ) . strftime ( "%m-%d-%Y" ) embed = discord . Embed ( colour = 3553599 ) embed . set_author ( name = res [ "display_name" ] , icon_url = "https://i.imgur.com/OQwQ8z0.jpg" , url = res [ "url" ] ) embed . add_field ( name = "Account ID" , value = res [ "_id" ] , inline = True ) embed . add_field ( name = "\u200B" , value = "\u200B" , inline = True ) embed . add_field ( name = "Followers" , value = res [ "followers" ] , inline = True ) embed . add_field ( name = "Created On" , value = creationdate , inline = True ) embed . add_field ( name = "\u200B" , value = "\u200B" , inline = True ) embed . add_field ( name = "Channel Views" , value = res [ "views" ] , inline = True ) await ctx . send ( embed = embed ) except Exception : await ctx . send ( f"Unable to find account: {account}. Are you sure you spelt it correctly?" )
Returns information on the Twitch account you want information on.
Returns information on the Twitch account you want information on .
"""Returns information on the Twitch account you want information on."""
self
ctx
account