import discord
from discord.ext import commands
from datetime import datetime
from discord import Option
class Secondary(commands.Cog):
def __init__(self, client):
self.client = client
@client.slash_command(description = "")
async def avatar(self, ctx, user: Option(discord.Member, "Choose a user to mention.")):
AvatarEmbed = discord.Embed(
title = f"{user}'s profile image.",
color = discord.Colour.dark_green()
)
AvatarEmbed.set_image(url = user.avatar.url)
AvatarEmbed.timestamp = datetime.utcnow()
await ctx.respond(embed = AvatarEmbed, ephemeral = False)
def setup(client):
client.add_cog(Secondary(client))
The code above is what's in my cog.
So I'm trying to make a "avatar" command to display the selected users profile picture. I'm not sure why but it keeps forcing me to enter "ctx" as a field. Here