Skip to content Skip to sidebar Skip to footer

Discord.py Spotify Doesnt Seem To Do Anything

I'm developing my first bot just as a hobby and something to help me learn some Python and I've been trying to integrate Spotify with it but it just doesn't seem to work. I also re

Solution 1:

You can try to check if it is a problem with your Intents. Import all with the following function:

intents = discord.Intents.all()
client = discord.Client(intents=intents)

Connected with a code the following command works fine for me:

from discord import Spotify

@bot.command()asyncdefspotify(ctx, user: discord.Member = None):
    if user == None:
        user = ctx.author
        passif user.activities:
        for activity in user.activities:
            ifisinstance(activity, Spotify):
                embed = discord.Embed(title = f"{user.name}'s Spotify", description = "Listening to{}".format(activity.title), color = 0xC902FF)
                embed.set_thumbnail(url=activity.album_cover_url)
                embed.add_field(name="Artist", value=activity.artist)
                embed.add_field(name="Album", value=activity.album)
                embed.set_footer(text="Song started at {}".format(activity.created_at.strftime("%H:%M")))
                await ctx.send(embed=embed)

The output:

enter image description here

Post a Comment for "Discord.py Spotify Doesnt Seem To Do Anything"