Original:
@client.tree.command()
@app_commands.describe(members='The members you want to get the joined date from; defaults to the user who uses the command')
async def joined(interaction: discord.Interaction, members: Optional[List[discord.Member]]):
"""Says when a members joined."""
# If no member is explicitly provided then we use the command user here
members = members or [interaction.user]
text = ""
for member in members:
text += f'{member} joined {discord.utils.format_dt(member.joined_at)}n'
# The format_dt function formats the date time into a human readable representation in the official client
await interaction.response.send_message(text)
members: Optional[List[discord.Member]]
I was:
/joined Member1 Member2 Member3 …
Error:
**unsupported type annotation typing.List[discord.member.Member]
File ““, line , in
async def joined(interaction: discord.Interaction, members: Optional[List[discord.Member]]):
TypeError: unsupported type annotation typing.List[discord.member.Member]
New contributor
Vanyla Self is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.