Async python wrapper for JeyyAPI
# import JeyyAPIClient
from jeyyapi import JeyyAPIClient
# Create JeyyAPICLient instance
client = JeyyAPIClient()
# fetch from `hearts` endpoint with its appropriate kwargs parameter
# returns io.BytesIO for image and discord endpoints
image = await client.hearts(image_url='IMAGE_URL', rainbow=True)
from jeyyapi import JeyyAPIClient
client = JeyyAPIClient()
# requires presence intent
@bot.command()
async def spotify(ctx, member: discord.Member=None):
member = member or ctx.author
spotify = discord.utils.find(lambda a: isinstance(a, discord.Spotify), member.activities)
if spotify is None:
return await ctx.send(f"**{member}** is not listening or connected to Spotify.")
image = await client.spotify_from_object(spotify)
await ctx.send(f"> **{member}** is listening to **{spotify.title}**", file=discord.File(image, 'spotify.png'))