Async python wrapper for JeyyAPI
$ pip install git+https://github.com/JeyyGit/jeyyapi.git
# import JeyyAPIClient
from jeyyapi import JeyyAPIClient
# Create JeyyAPICLient instance
client = JeyyAPIClient('YOUR_API_KEY_HERE')
# 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('YOUR_API_KEY_HERE')
# 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'))