#Best way to do optional slash options?
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
@slash_command(
name="avatar",
description="Shows your avatar or a user",
options=[
SlashCommandOption(
name="user",
description="User to view the avatar.",
type=OptionType.USER,
required=False,
)
],
)
async def avatar(self, ctx: SlashContext, user: Member = None):
_user: User = ctx.author.user if user is None else user
Something like this will do